worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream localhost{ #这里指定多个源服务器,ip:端口,80端口的话可写可不写 server 127.0.0.1:8080; } server { listen 80; location ~ \.jsp$ { proxy_pass http://localhost; } location ~ \.(html|js|css|png|gif)$ { root E:\work\livecourse-v2\livecourse-web; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
参考:http://zyjustin9.iteye.com/blog/2017394