And*_*yHe 0 admin backend nginx node.js
我一直在试图弄清楚如何将服务器指向我的静态页面,我将它存储在我的云服务器中的某个地方。另外,我使用 NodeJs 作为我的后端。
我的老问题:它不是指向我的 myProjectX index.html 而是指向 Nginx 默认网页“欢迎使用 Nginx!”。我不知道为什么;/
更新
我的新问题:在我做的这个新配置之后,它指向一个 404 页面而不是指向我的 index.html
此外,在第 20 行中,当我出于调试目的运行 sudo nginx -t 时,它给了我重复“/”的错误
`nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/default:20 `
Run Code Online (Sandbox Code Playgroud)
这是我的 Nginx 配置文件...
`nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/default:20 `
Run Code Online (Sandbox Code Playgroud)
参考这个博客 http://caffeinecodes.blogspot.in/2017/02/nginx-settings.html
server {
listen 80;
server_name test.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
alias /Users/Afxal/workspace/test_project/static/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8000;
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2567 次 |
最近记录: |