nginx_tomcat
Posted 冯俊杰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx_tomcat相关的知识,希望对你有一定的参考价值。
log_format weparts ‘$remote_addr [$time_iso8601] $request - $status "$http_user_agent" $body_bytes_sent $request_time‘;
server {
listen 80;
server_name 192.168.1.240 weparts.org *.weparts.org;
rewrite ^(.*)$ https://www.weparts.org$1 permanent;
}
server {
listen 443 ssl;
server_name www.weparts.org;
ssl_protocols TLSv1.2;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_prefer_server_ciphers on;
ssl_certificate cert/www.weparts.org.crt;
ssl_certificate_key cert/www.weparts.org.key;
ssl_session_cache shared:SSL:5m;
ssl_session_timeout 10m;
charset utf-8;
access_log /var/log/nginx/weparts.access.log weparts;
gzip on;
gzip_types application/x-javascript text/css application/json;
location / {
proxy_pass http://127.0.0.1:8180;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect http:// https://;
}
location /webSocketServer {
proxy_pass http://127.0.0.1:8180;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
location /resources/ {
root /var/lib/tomcats/weparts/webapps/ROOT;
}
location /nginx {
stub_status on;
access_log off;
}
}
以上是关于nginx_tomcat的主要内容,如果未能解决你的问题,请参考以下文章