Authored by 梁志锋

备份nginx的修改

1 - # app api 1 + #app api
2 location =/appembed { 2 location =/appembed {
3 default_type application/json; 3 default_type application/json;
4 return 200 '{"code":200,"message":"app embed","data":{"open":"N","url":"http://m.yohobuy.com"}}'; 4 return 200 '{"code":200,"message":"app embed","data":{"open":"N","url":"http://m.yohobuy.com"}}';
1 - # idc old proxy 1 + #idc old proxy
2 location =/invite.html { 2 location =/invite.html {
3 access_log /Data/logs/access.m.yohobuy.com.log fenxi; 3 access_log /Data/logs/access.m.yohobuy.com.log fenxi;
4 proxy_redirect off; 4 proxy_redirect off;
@@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
194 } 194 }
195 195
196 location =/product/new/index { 196 location =/product/new/index {
197 - return 301 https://m.yohobuy.com/product/new; 197 + return 301 http://m.yohobuy.com/product/new;
198 } 198 }
199 199
200 200
@@ -208,17 +208,22 @@ @@ -208,17 +208,22 @@
208 } 208 }
209 209
210 location =/help.html { 210 location =/help.html {
211 - return 301 https://m.yohobuy.com/home/help; 211 + return 301 http://m.yohobuy.com/home/help;
212 } 212 }
213 213
214 location ^~ /trends_detail_ { 214 location ^~ /trends_detail_ {
215 - return 301 https://guang.m.yohobuy.com; 215 + return 301 http://guang.m.yohobuy.com;
216 } 216 }
217 217
218 - location =/about {  
219 - return 301 https://$host$request_uri;  
220 - } 218 + #location =/about {
  219 + # return 301 http://$host$request_uri;
  220 + # }
  221 +
  222 + #location =/brand/index/about{
  223 + # return 301 http://$host$request_uri;
  224 + # }
221 225
222 - location =/brand/index/about{  
223 - return 301 https://$host$request_uri; 226 + location ^~ /product/pro_ {
  227 + return 301 http://item.m.yohobuy.com$request_uri;
224 } 228 }
  229 +
1 - location ^~ /passport/login/wechat/ { 1 +
  2 +location ^~ /passport/login/wechat/ {
2 proxy_redirect off; 3 proxy_redirect off;
3 proxy_pass http://yohobuywap-node; 4 proxy_pass http://yohobuywap-node;
4 proxy_set_header Host $host; 5 proxy_set_header Host $host;
5 proxy_set_header X-Real-IP $remote_addr; 6 proxy_set_header X-Real-IP $remote_addr;
6 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 7 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
7 proxy_set_header Accept-Encoding "gzip"; 8 proxy_set_header Accept-Encoding "gzip";
8 - } 9 +}
9 10
10 - location ^~ /activity { 11 +location ^~ /activity {
11 proxy_redirect off; 12 proxy_redirect off;
12 proxy_pass http://yohobuywap-node; 13 proxy_pass http://yohobuywap-node;
13 proxy_set_header Host $host; 14 proxy_set_header Host $host;
14 proxy_set_header X-Real-IP $remote_addr; 15 proxy_set_header X-Real-IP $remote_addr;
15 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 16 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16 proxy_set_header Accept-Encoding "gzip"; 17 proxy_set_header Accept-Encoding "gzip";
17 - } 18 +}
18 19
19 - location = /coupon/index {  
20 - return 301 /activity/coupon?$query_string;  
21 - }  
22 20
23 - location ^~ /product/sale/ { 21 +location ^~ /product/sale/ {
24 proxy_redirect off; 22 proxy_redirect off;
25 proxy_pass http://yohobuywap-node; 23 proxy_pass http://yohobuywap-node;
26 proxy_set_header Host $host; 24 proxy_set_header Host $host;
27 proxy_set_header X-Real-IP $remote_addr; 25 proxy_set_header X-Real-IP $remote_addr;
28 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 26 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
29 proxy_set_header Accept-Encoding "gzip"; 27 proxy_set_header Accept-Encoding "gzip";
30 - } 28 +}
31 29
32 - location ^~ /guang/star/ { 30 +location ^~ /guang/star/ {
33 proxy_redirect off; 31 proxy_redirect off;
34 proxy_pass http://yohobuywap-node; 32 proxy_pass http://yohobuywap-node;
35 proxy_set_header Host $host; 33 proxy_set_header Host $host;
36 proxy_set_header X-Real-IP $remote_addr; 34 proxy_set_header X-Real-IP $remote_addr;
37 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 35 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38 proxy_set_header Accept-Encoding "gzip"; 36 proxy_set_header Accept-Encoding "gzip";
39 - } 37 +}
40 38
41 39
42 - location ^~ /product/outlet/ { 40 +location ^~ /product/outlet/ {
43 proxy_redirect off; 41 proxy_redirect off;
44 proxy_pass http://yohobuywap-node; 42 proxy_pass http://yohobuywap-node;
45 proxy_set_header Host $host; 43 proxy_set_header Host $host;
46 proxy_set_header X-Real-IP $remote_addr; 44 proxy_set_header X-Real-IP $remote_addr;
47 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 45 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48 proxy_set_header Accept-Encoding "gzip"; 46 proxy_set_header Accept-Encoding "gzip";
49 - }  
  47 +}
1 -  
2 - #app show help page  
3 - location =/help/shareorder.html {  
4 - root /Data/PE/yohobuy_H5/assets;  
5 - expires 7d; 1 + # wechat pay
  2 + location ^~ /shopping/pay/aliwapreturn {
  3 + proxy_redirect off;
  4 + proxy_pass http://yohobuy;
  5 + proxy_set_header Host m.yohobuy.com;
  6 + proxy_set_header X-Real-IP $remote_addr;
  7 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8 + proxy_set_header Accept-Encoding "gzip";
6 } 9 }
7 10
8 -  
9 - # product detail page 301 redirect to item use https  
10 - location ^~ /product/pro_ {  
11 - return 301 https://item.m.yohobuy.com$request_uri; 11 + location ^~ /home/orders/pay {
  12 + proxy_redirect off;
  13 + proxy_pass http://yohobuy;
  14 + proxy_set_header Host $host;
  15 + proxy_set_header X-Real-IP $remote_addr;
  16 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  17 + proxy_set_header Accept-Encoding "gzip";
12 } 18 }
13 19
14 - location ^~ /shopping/pay/aliwapreturn { 20 + location ^~ /shopping/pay/wechatwapapi {
15 proxy_redirect off; 21 proxy_redirect off;
16 proxy_pass http://yohobuy; 22 proxy_pass http://yohobuy;
17 - proxy_set_header Host m.yohobuy.com; 23 + proxy_set_header Host $host;
18 proxy_set_header X-Real-IP $remote_addr; 24 proxy_set_header X-Real-IP $remote_addr;
19 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 25 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20 proxy_set_header Accept-Encoding "gzip"; 26 proxy_set_header Accept-Encoding "gzip";
21 } 27 }
22 28
23 - location / { 29 + location ^~ /coupon {
24 proxy_redirect off; 30 proxy_redirect off;
25 proxy_pass http://yohobuy; 31 proxy_pass http://yohobuy;
26 proxy_set_header Host $host; 32 proxy_set_header Host $host;
@@ -28,3 +34,5 @@ @@ -28,3 +34,5 @@
28 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 34 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
29 proxy_set_header Accept-Encoding "gzip"; 35 proxy_set_header Accept-Encoding "gzip";
30 } 36 }
  37 +
  38 +
1 - # static file 1 + #static file
2 location =/favicon.ico { 2 location =/favicon.ico {
3 expires 7d; 3 expires 7d;
4 } 4 }
@@ -23,7 +23,6 @@ @@ -23,7 +23,6 @@
23 expires 7d; 23 expires 7d;
24 } 24 }
25 25
26 - ##百度站长的校验文件, 百度站长账号feng322169 密码yoho9646  
27 location = /baidu_verify_bXX90VTyvs.html { 26 location = /baidu_verify_bXX90VTyvs.html {
28 root /Data/PE/yohobuy_H5/assets; 27 root /Data/PE/yohobuy_H5/assets;
29 expires 7d; 28 expires 7d;
@@ -6,38 +6,25 @@ server @@ -6,38 +6,25 @@ server
6 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi; 6 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
7 error_log /Data/logs/error_wap.yohobuy.com.log warn; 7 error_log /Data/logs/error_wap.yohobuy.com.log warn;
8 8
  9 + # old idc
  10 + include vhosts/location/yohobuywap_idc.conf;
9 # app 11 # app
10 include vhosts/location/yohobuywap_app.conf; 12 include vhosts/location/yohobuywap_app.conf;
  13 + # php
  14 + include vhosts/location/yohobuywap_php.conf;
  15 + # node
  16 + include vhosts/location/yohobuywap_node.conf;
  17 + # static file
  18 + include vhosts/location/yohobuywap_static.conf;
11 19
12 - #for wechat pay  
13 - location ^~ /home/orders/pay {  
14 - proxy_redirect off;  
15 - proxy_pass http://yohobuy;  
16 - proxy_set_header Host $host;  
17 - proxy_set_header X-Real-IP $remote_addr;  
18 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
19 - proxy_set_header Accept-Encoding "gzip";  
20 - } 20 + #https flag, 1 means HTTPS, 0 means HTTP
  21 + set $httpsFlag 0;
21 22
22 - location ^~ /shopping/pay/wechatwapapi {  
23 - proxy_redirect off;  
24 - proxy_pass http://yohobuy;  
25 - proxy_set_header Host $host;  
26 - proxy_set_header X-Real-IP $remote_addr;  
27 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
28 - proxy_set_header Accept-Encoding "gzip"; 23 + location / {
  24 + if ($httpsFlag = 1) {
  25 + return 301 https://$host$request_uri;
29 } 26 }
30 27
31 - # location =/shopping/pay/aliwapreturn {  
32 - # proxy_redirect off;  
33 - # proxy_pass http://yohobuy_idc;  
34 - # proxy_set_header Host $host;  
35 - # proxy_set_header X-Real-IP $remote_addr;  
36 - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
37 - # proxy_set_header Accept-Encoding "gzip";  
38 - # }  
39 -  
40 - location ^~ /coupon {  
41 proxy_redirect off; 28 proxy_redirect off;
42 proxy_pass http://yohobuy; 29 proxy_pass http://yohobuy;
43 proxy_set_header Host $host; 30 proxy_set_header Host $host;
@@ -45,14 +32,8 @@ server @@ -45,14 +32,8 @@ server
45 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 32 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
46 proxy_set_header Accept-Encoding "gzip"; 33 proxy_set_header Accept-Encoding "gzip";
47 } 34 }
48 -  
49 - # others http 301 redirect https  
50 - location / {  
51 - return 301 https://m.yohobuy.com$request_uri;  
52 - }  
53 } 35 }
54 36
55 -  
56 server 37 server
57 { 38 {
58 listen 443; 39 listen 443;
@@ -61,6 +42,9 @@ server @@ -61,6 +42,9 @@ server
61 ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/yohobuy.pem; 42 ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/yohobuy.pem;
62 ssl_certificate_key /Data/local/nginx-1.8.0/conf/ssl/yohobuy.key; 43 ssl_certificate_key /Data/local/nginx-1.8.0/conf/ssl/yohobuy.key;
63 44
  45 + # https key
  46 + include vhosts/location/yohobuywap_httpskey.conf;
  47 +
64 root /Data/PE/yohobuy_H5/yohobuy/m.yohobuy.com/public; 48 root /Data/PE/yohobuy_H5/yohobuy/m.yohobuy.com/public;
65 49
66 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi; 50 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
@@ -77,18 +61,52 @@ server @@ -77,18 +61,52 @@ server
77 # static file 61 # static file
78 include vhosts/location/yohobuywap_static.conf; 62 include vhosts/location/yohobuywap_static.conf;
79 63
80 - #for we chat pay  
81 - location =/home/orders/pay{ 64 + #https flag, 1 means HTTPS, 0 means HTTP
  65 + set $httpsFlag 0;
  66 +
  67 + location / {
  68 + if ($httpsFlag = 0) {
82 return 301 http://$host$request_uri; 69 return 301 http://$host$request_uri;
83 } 70 }
84 - location =/shopping/pay/wechatwapapi {  
85 - return 301 http://$host$request_uri; 71 + proxy_redirect off;
  72 + proxy_pass http://yohobuy;
  73 + proxy_set_header Host $host;
  74 + proxy_set_header X-Real-IP $remote_addr;
  75 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  76 + proxy_set_header Accept-Encoding "gzip";
86 } 77 }
  78 +}
87 79
88 - #location =/shopping/pay/aliwapreturn {  
89 - # return 301 http://$host$request_uri;  
90 - #} 80 +server
  81 +{
  82 +
  83 + listen 80;
  84 + server_name guang.m.yohobuy.com;
  85 +
  86 + access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
  87 + error_log /Data/logs/error_wap.yohobuy.com.log warn;
91 88
  89 + # static file
  90 + include vhosts/location/yohobuywap_static.conf;
  91 +
  92 + # guang rss
  93 + location ^~ /rss {
  94 + proxy_redirect off;
  95 + proxy_pass http://yohobuy;
  96 + proxy_set_header Host $host;
  97 + proxy_set_header X-Real-IP $remote_addr;
  98 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  99 + proxy_set_header Accept-Encoding "gzip";
  100 + }
  101 +
  102 + location / {
  103 + proxy_redirect off;
  104 + proxy_pass http://yohobuy;
  105 + proxy_set_header Host $host;
  106 + proxy_set_header X-Real-IP $remote_addr;
  107 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  108 + proxy_set_header Accept-Encoding "gzip";
  109 + }
92 } 110 }
93 111
94 server 112 server
@@ -99,10 +117,23 @@ server @@ -99,10 +117,23 @@ server
99 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi; 117 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
100 error_log /Data/logs/error_wap.yohobuy.com.log warn; 118 error_log /Data/logs/error_wap.yohobuy.com.log warn;
101 119
102 - # others http 301 redirect https 120 + # static file
  121 + include vhosts/location/yohobuywap_static.conf;
  122 +
  123 + #https flag, 1 means HTTPS, 0 means HTTP
  124 + set $httpsFlag 0;
  125 +
103 location / { 126 location / {
  127 + if ($httpsFlag = 1) {
104 return 301 https://$host$request_uri; 128 return 301 https://$host$request_uri;
105 } 129 }
  130 + proxy_redirect off;
  131 + proxy_pass http://yohobuy;
  132 + proxy_set_header Host $host;
  133 + proxy_set_header X-Real-IP $remote_addr;
  134 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  135 + proxy_set_header Accept-Encoding "gzip";
  136 + }
106 } 137 }
107 138
108 server 139 server
@@ -116,7 +147,6 @@ server @@ -116,7 +147,6 @@ server
116 # https key 147 # https key
117 include vhosts/location/yohobuywap_httpskey.conf; 148 include vhosts/location/yohobuywap_httpskey.conf;
118 149
119 -  
120 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi; 150 access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
121 error_log /Data/logs/error_wap.yohobuy.com.log warn; 151 error_log /Data/logs/error_wap.yohobuy.com.log warn;
122 152
@@ -135,7 +165,6 @@ server @@ -135,7 +165,6 @@ server
135 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 165 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
136 proxy_set_header Accept-Encoding "gzip"; 166 proxy_set_header Accept-Encoding "gzip";
137 } 167 }
138 -  
139 # guang rss 168 # guang rss
140 location ^~ /rss { 169 location ^~ /rss {
141 proxy_redirect off; 170 proxy_redirect off;
@@ -146,7 +175,13 @@ server @@ -146,7 +175,13 @@ server
146 proxy_set_header Accept-Encoding "gzip"; 175 proxy_set_header Accept-Encoding "gzip";
147 } 176 }
148 177
  178 + #https flag, 1 means HTTPS, 0 means HTTP
  179 + set $httpsFlag 0;
  180 +
149 location / { 181 location / {
  182 + if ($httpsFlag = 0) {
  183 + return 301 http://$host$request_uri;
  184 + }
150 proxy_redirect off; 185 proxy_redirect off;
151 proxy_pass http://yohobuy; 186 proxy_pass http://yohobuy;
152 proxy_set_header Host $host; 187 proxy_set_header Host $host;
@@ -154,7 +189,7 @@ server @@ -154,7 +189,7 @@ server
154 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 189 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
155 proxy_set_header Accept-Encoding "gzip"; 190 proxy_set_header Accept-Encoding "gzip";
156 } 191 }
157 -} 192 + }
158 193
159 server 194 server
160 { 195 {
@@ -174,7 +209,7 @@ server @@ -174,7 +209,7 @@ server
174 } 209 }
175 } 210 }
176 211
177 - server 212 +server
178 { 213 {
179 listen 443; 214 listen 443;
180 server_name analytics.m.yohobuy.com; 215 server_name analytics.m.yohobuy.com;
@@ -193,5 +228,26 @@ server @@ -193,5 +228,26 @@ server
193 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 228 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
194 proxy_set_header Accept-Encoding "gzip"; 229 proxy_set_header Accept-Encoding "gzip";
195 } 230 }
  231 +}
  232 +
  233 + server
  234 +{
  235 + listen 80;
  236 + server_name analytics.m.yohobuy.com;
  237 +
  238 + # ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/m.yohobuy.pem;
  239 + # ssl_certificate_key /Data/local/nginx-1.8.0/conf/ssl/m.yohobuy.key;
  240 +
  241 + # https key
  242 + # include vhosts/location/yohobuywap_httpskey.conf;
  243 +
  244 + location / {
  245 + proxy_redirect off;
  246 + proxy_pass http://yohobuy_analytics;
  247 + proxy_set_header Host $host;
  248 + proxy_set_header X-Real-IP $remote_addr;
  249 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  250 + proxy_set_header Accept-Encoding "gzip";
  251 + }
196 252
197 } 253 }
@@ -67,7 +67,7 @@ server @@ -67,7 +67,7 @@ server
67 error_log /Data/logs/error_wap.yohobuy.com.log warn; 67 error_log /Data/logs/error_wap.yohobuy.com.log warn;
68 68
69 # old idc 69 # old idc
70 - include vhosts/location/yohobuywap_idc_nohttps.conf; 70 + include vhosts/location/yohobuywap_idc.conf;
71 # app 71 # app
72 include vhosts/location/yohobuywap_app.conf; 72 include vhosts/location/yohobuywap_app.conf;
73 # php 73 # php
@@ -77,42 +77,17 @@ server @@ -77,42 +77,17 @@ server
77 # static file 77 # static file
78 include vhosts/location/yohobuywap_static.conf; 78 include vhosts/location/yohobuywap_static.conf;
79 79
80 - #for wechat pay  
81 - location ^~ /home/orders/pay {  
82 - proxy_redirect off;  
83 - proxy_pass http://yohobuy;  
84 - proxy_set_header Host $host;  
85 - proxy_set_header X-Real-IP $remote_addr;  
86 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
87 - proxy_set_header Accept-Encoding "gzip"; 80 + #for we chat pay
  81 + location =/home/orders/pay{
  82 + return 301 http://$host$request_uri;
88 } 83 }
89 -  
90 - location ^~ /shopping/pay/wechatwapapi {  
91 - proxy_redirect off;  
92 - proxy_pass http://yohobuy;  
93 - proxy_set_header Host $host;  
94 - proxy_set_header X-Real-IP $remote_addr;  
95 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
96 - proxy_set_header Accept-Encoding "gzip"; 84 + location =/shopping/pay/wechatwapapi {
  85 + return 301 http://$host$request_uri;
97 } 86 }
98 87
99 - # location =/shopping/pay/aliwapreturn {  
100 - # proxy_redirect off;  
101 - # proxy_pass http://yohobuy_idc;  
102 - # proxy_set_header Host $host;  
103 - # proxy_set_header X-Real-IP $remote_addr;  
104 - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
105 - # proxy_set_header Accept-Encoding "gzip";  
106 - # }  
107 -  
108 - location ^~ /coupon {  
109 - proxy_redirect off;  
110 - proxy_pass http://yohobuy;  
111 - proxy_set_header Host $host;  
112 - proxy_set_header X-Real-IP $remote_addr;  
113 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
114 - proxy_set_header Accept-Encoding "gzip";  
115 - } 88 + #location =/shopping/pay/aliwapreturn {
  89 + # return 301 http://$host$request_uri;
  90 + #}
116 91
117 } 92 }
118 93