1
realpg 2016-04-12 15:20:19 +08:00 1
tomcat 监听指定一个 IP 比如 127.0.0.2
然后 nginx 直接反代过去 |
2
letitbesqzr 2016-04-12 15:58:29 +08:00 1
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; ``` |
3
chaegumi OP 我现在要往 nginx 代理到 tomcat 思路转了, tomcat 的文档不好阅读,关联页面太多。我仅仅只是想要用 cas sso 这个项目而已。
|
4
chaegumi OP |
5
defunct9 2016-04-12 17:01:03 +08:00
|