#映射jade2开头的url到指定web服务器(比如tomcat),url: http://localhost:7080/jade2/index.jsp location ^~ /jade2/ { root html; index index.html index.htm; proxy_pass http://10.181.0.128:8081; proxy_set_header X-Real-IP $remote_addr; expires 30d;#客户端缓存30天 } #映射所有未配置的url到8080端口 location ^~ / { root html; index index.html index.htm; proxy_pass http://localhost:8080; proxy_set_header X-Real-IP $remote_addr; }