这里有一个http://example.com
基于 4000 端口的服务,我http://example.com/index.html
现在可以访问。当我访问时http://example.com
,我希望它index.html
也能访问。这是我的 nginx 设置:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name example.com ;
location / {
root /wwwroot/product/example.com/programs/web.broswer/app;
index index.html;
proxy_pass http://localhost:4000; # 映射到本地端口
#proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 配置支持websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
现在,该路径/
不是的资源index.html
。