diff --git a/doc/ng/ng.sh b/doc/ng/ng.sh new file mode 100644 index 0000000..3921f31 --- /dev/null +++ b/doc/ng/ng.sh @@ -0,0 +1 @@ + docker run -d --name nginx -p 80:80 -p 443:443 -p 9200:9200 -v /var/www/web/vhost:/etc/nginx/conf.d -v /var/www/web/sites:/usr/share/nginx/html nginx \ No newline at end of file diff --git a/doc/ng/voucher.conf b/doc/ng/voucher.conf new file mode 100644 index 0000000..b1301dc --- /dev/null +++ b/doc/ng/voucher.conf @@ -0,0 +1,39 @@ +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; + } +} \ No newline at end of file diff --git a/doc/ng/voucher_1_9200.conf b/doc/ng/voucher_1_9200.conf new file mode 100644 index 0000000..9f85479 --- /dev/null +++ b/doc/ng/voucher_1_9200.conf @@ -0,0 +1,31 @@ +upstream voucher{ + # 第一个后端服务器 + server 172.29.42.89:13000 backup; + # 新增第二个后端服务器 + server 172.29.42.90:13000; +} + +server { + listen 9200; + 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 / { + 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://voucher; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/doc/ng/voucher_2_9200.conf b/doc/ng/voucher_2_9200.conf new file mode 100644 index 0000000..0f94eec --- /dev/null +++ b/doc/ng/voucher_2_9200.conf @@ -0,0 +1,32 @@ + +upstream voucher{ + # 第一个后端服务器 + server 172.29.42.89:13000; + # 新增第二个后端服务器 + server 172.29.42.90:13000 backup; +} + +server { + listen 9200; + 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 / { + 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://voucher; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file