配置文件如下

server {
listen 80;
listen [::]:80;
server_name ci.10086z.cn;
location / {
rewrite (.*) https://ci.10086z.cn$1 permanent;
try_files $uri $uri/ =404;
}
}

server {
listen 443 ssl;
server_name ci.10086z.cn; #填写绑定证书的域名
ssl on;
ssl_certificate /etc/nginx/ssl/1_ci.10086z.cn_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/2_ci.10086z.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# 按照这个套件配置
ssl_prefer_server_ciphers on;
root /var/www/html;

location / {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 500m;
index index.html index.htm;
}

}

配置springboot应用的代理

server {
listen 80;
listen [::]:80;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name www.10086z.cn;

location / {
rewrite (.*) https://www.10086z.cn$1 permanent;
try_files $uri $uri/ =404;
}


location /image/ {
root /data/;
autoindex on;
}
}


server {
listen 443 ssl;
server_name www.10086z.cn; #填写绑定证书的域名
ssl on;
ssl_certificate /etc/nginx/ssl/1_www.10086z.cn_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/2_www.10086z.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# 按照这个套件配置
ssl_prefer_server_ciphers on;
root /var/www/html;
location / {
index index.html index.htm;
}

location /app {
proxy_pass http://127.0.0.1:8089/app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
#root html;
index index.html index.htm;
}

location /pagoda {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
#root html;
index index.html index.htm;
}

location /interview {
proxy_pass http://127.0.0.1:8081/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
#root html;
index index.html index.htm;
}

location /redwood {
proxy_pass http://127.0.0.1:10001/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
#root html;
index index.html index.htm;
}



}