hatim 5 gadi atpakaļ
vecāks
revīzija
7ca98ce6f1
1 mainītis faili ar 50 papildinājumiem un 4 dzēšanām
  1. 50 4
      规范/运维/部署环境/nginx部署.md

+ 50 - 4
规范/运维/部署环境/nginx部署.md

@@ -16,7 +16,7 @@ apt-get install nginx
 
 ### nginx.conf
 
-```
+```properties
 user root;
 worker_processes auto;
 
@@ -83,7 +83,7 @@ http {
 
 ### vhost/saas-admin.conf
 
-```
+```properties
 server {
     listen 8171;
     server_name 127.0.0.1;
@@ -117,7 +117,7 @@ server {
 
 ### vhost/admin.conf
 
-```
+```properties
 server {
     listen 3000;
     server_name 127.0.0.1;
@@ -151,7 +151,7 @@ server {
 
 ### vhost/wechat_nginx.conf
 
-```
+```properties
 server {
     listen 80;
     server_name  wechat2.huifuwu.cn;
@@ -181,6 +181,52 @@ server {
 }
 ```
 
+### https配置
+
+```properties
+server {
+    listen 80;
+    server_name wy-test.huiguanjia.cn;
+    return 301 https://wy-test.huiguanjia.cn$request_uri;
+}
+server {
+    listen 443;
+    server_name wy-test.huiguanjia.cn;
+
+    root   html;
+    index  index.html index.htm index.php;
+
+    ssl on;
+    ssl_certificate cert/wy-test.huiguanjia.cn.pem;
+    ssl_certificate_key cert/wy-test.huiguanjia.cn.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 / {
+        proxy_pass  http://172.16.0.223:3000/;
+
+        #Proxy Settings
+        proxy_redirect     off;
+        proxy_set_header   Host             $host;
+        proxy_set_header   X-Real-IP        $remote_addr;
+        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
+        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
+        proxy_max_temp_file_size 0;
+        proxy_connect_timeout      300;
+        proxy_send_timeout         300;
+        proxy_read_timeout         300;
+        proxy_buffer_size          4k;
+        proxy_buffers              4 32k;
+        proxy_busy_buffers_size    64k;
+        proxy_temp_file_write_size 64k;
+   }
+}
+```
+
+
+
 ### 启动、关闭命令
 
 ```shell