Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

根据文档的nginx.conf 配置问题 #37

Open
sonygod opened this issue Jan 13, 2019 · 0 comments
Open

根据文档的nginx.conf 配置问题 #37

sonygod opened this issue Jan 13, 2019 · 0 comments

Comments

@sonygod
Copy link

sonygod commented Jan 13, 2019

步骤:

1 按照文档配置完善,正常ip+8360可以访问 例如 http://127.0.0.1:8360

2:按照这里的https://www.cmswing.com/p/404.html 使用nginx配置,另存为shop.conf软连接

include shop.conf; 

nginx -t 测试没有问题,重启

3:访问域名http://xxx.com/index.js 提示404

我的shop.conf

server {
listen 80;
server_name www.mygame.com;
root /home/wwwroot/default;
set $node_port 8360;
index index.js index.html index.htm;
if ( -f $request_filename/index.html ){
    rewrite (.*) $1/index.html break;
}
if ( !-f $request_filename ){
    rewrite (.*) /index.js;
}
location = /index.js {
    proxy_http_version 1.1;
    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 Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_pass http://127.0.0.1:$node_port$request_uri;
    proxy_redirect off;
}
location ~ /static/ {
    etag         on;
    expires      max;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant