![Nginx 代理传递时没有出现此文件或目录错误](https://linux22.com/image/678394/Nginx%20%E4%BB%A3%E7%90%86%E4%BC%A0%E9%80%92%E6%97%B6%E6%B2%A1%E6%9C%89%E5%87%BA%E7%8E%B0%E6%AD%A4%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%E9%94%99%E8%AF%AF.png)
我已经配置了 nginx,将 nodejs 服务器(8081)端口传递给外部 urlhttps://example.com/myapp
MyApp = nodejs 服务器 api 并且运行良好
我有另一个管理控制界面,完整的网址是https://example.com/myapp/admin
当我尝试登录管理界面时出现错误。使用 http url 可以正常工作。
错误日志:
2016/03/08 11:20:28 [error] 25762#0: *16 open() "/usr/share/nginx/html/example.com/apis/users/admin/login/email" failed (2: No such file or directory), client: 202.164.23.112, server: example.com, request: "POST /apis/users/admin/login/email HTTP/1.1", host: "example.com", referrer: "https://example.com/myapp/admin"
其中 apis/users/admin/login/email 都是页面,而不是目录。
Nginx 服务器配置: /etc/nginx/sites-enabled/default
server {
listen 80 default_server;
server_name localhost;
listen 443;
root /usr/share/nginx/html;
index index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
location /myapp/ {
proxy_pass https://0.0.0.0:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
rewrite ^/myapp/(.*) /$1 break;
}
请提供建议并提前致谢: