Nginx配置
server {
listen mysite.com:80; #如:listen 80
server_name mysite.com; #如:localhost
root /path/to/tomcat/webapps/mysite/;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8082/; 这个地方的端口是Tomcat的端口号,如果你没有更改过tomcat的server.xml 那这个就是8080
}
}
Tomcat配置:
见之前一篇:http://sjasonzhang.blogspot.jp/2014/11/blog-post.html