nginx不在root / somename上的根主机上运行

如何让nginx忽略http://127.0.0.1/请求,但从http://127.0.0.1/ html目录中提取出来,这也需要与/data/


我已经尝试了下面,只得到404。

 server { listen 80; server_name localhost; location / { #Do I need something in here regardless? } location /somename { root ../html; index index.html index.htm; } #reverse proxy for ie support # location /somename/data { proxy_pass http://localhost:8080/data/; proxy_set_header host localhost; } # redirect error pages to the static pages /50x.html /40x.html error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root ../html; } location = /404.html { root ../html; } } 

你是什​​么意思“忽略”? 如果你访问http://127.0.0.1/ ,你想要什么行为?

如果你访问一个你的web服务器没有文件发送回客户端的path,我认为你有404是合理的。