代码拉取完成,页面将自动刷新
同步操作将从 rosiky9527/hapi-server 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
小程序后台服务
主要采用 hapi+mysql搭建的接口服务(用hapi-swagger提供了接口文档) 另外采用nginx代理static文件夹下的静态资源(这块资源后期会新建web项目,打包后拷进static文件夹)
#user nobody; worker_processes 1;
#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;
#pid logs/nginx.pid;
events { worker_connections 1024; }
http { include mime.types; default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name 127.0.0.1;
#charset koi8-r;
#access_log logs/host.access.log main;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$
{
root D:\hapi-server\static;
#expires 30d;
expires -1;
}
location ~ .*\.(css)?$
{
root D:\hapi-server\static;
#expires 1h;
expires -1;
}
location ~ .*\.(js)?$
{
root D:\hapi-server\static;
#expires 1h;
expires -1;
}
location ~ .*\.(html|htm)?$
{
root D:\hapi-server\static;
#expires 1h;
expires -1;
error_page 404 /404.html;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
#proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
proxy_pass http://localhost:3000;
}
error_page 404 /404.html;
location = /404.html {
root D:\hapi-server\static;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root D:\hapi-server\static;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
nginx这边 很奇怪,大概看了下,error.log 错在请求的静态文件路。我目前配置的静态文件路径是D:\hapi-server\static,但是/documentation有引入nodemodules下的文件
D:\hapi-server\node_modules\hapi-swagger\public\swaggerui,这就导致找不到文件,这里先放着,访问3000也能访问,而且对nginx配置还不是很了解,后期再优化。
而且,mode_modules里,hapi-swagger下,大概看了下,貌似插件自己建了个服务器??
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。