39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
upstream voucherServer{
|
|
least_conn;
|
|
# 第一个后端服务器
|
|
server 172.29.42.89:9200;
|
|
# 新增第二个后端服务器
|
|
server 172.29.42.90:9200;
|
|
}
|
|
|
|
server {
|
|
listen 443;
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name voucher.86698.cn;
|
|
ssl_certificate /etc/nginx/conf/certs/voucher.pem;
|
|
ssl_certificate_key /etc/nginx/conf/certs/voucher.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;
|
|
#access_log /var/log/nginx/host.access.log main;
|
|
|
|
location / {
|
|
root /usr/share/nginx/html/web;
|
|
index index.html index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /voucher {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header referer $http_referer;
|
|
proxy_pass http://voucherServer;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
} |