client -> nginx(ssl) -> tomcat
tomcat 不需要再配置 nginx 了..
发下我的一个配置:
```
<Host name="
www.xxxxx.com" appBase=""
unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" reloadable="true" workDir="work" docBase="project/cmc"/>
</Host>
```
nginx
```
server {
listen 443;
server_name
www.xxxxx.com;
access_log /var/log/weblog/xxxx_com_access.log main;
error_log /var/log/weblog/xxxx_com_error.log debug;
ssl on;
ssl_certificate /usr/local/nginx/conf/ssl/xxxx.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/xxxx.key;
location /
{
proxy_pass http://127.0.0.1:2600; // tomcat port
include naproxy.conf;
}
}
```
naproxy.conf
```
proxy_connect_timeout 30s;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_set_header Host $host;
proxy_set_header Referer $http_referer;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
```