Nginx反向代理Tomcat

修改配置文件

1
sudo vim /etc/nginx/nginx.conf

配置文件内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
server {
        root /var/www/html;
        server_name yibuwulianwang.com;
        listen 443;
        ssl on;
        ssl_certificate    cert/yibuwulianwang.com.crt;
        ssl_certificate_key   cert/yibuwulianwang.com.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    	ssl_prefer_server_ciphers on;

        location / {
                index index.html index.htm;
                proxy_pass https://yibuwulianwang.com:8443;
        }

        location ~ \.jsp$ {
                proxy_pass https://yibuwulianwang.com:8443;
        }

        location ~ \.(html|js|css|png|gif|jpg)$ {
                root /opt/tomcat/9.0.2/webapps/ROOT;
        }

}

server {
        listen 80;
        server_name yibuwulianwang.com;
        rewrite ^(.*)$ https://$server_name$1 permanent;
}

今日诗词

作者信息