Showing
8 changed files
with
243 additions
and
202 deletions
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"}}'; |
@@ -29,4 +29,4 @@ | @@ -29,4 +29,4 @@ | ||
29 | proxy_set_header X-Real-IP $remote_addr; | 29 | proxy_set_header X-Real-IP $remote_addr; |
30 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 30 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
31 | proxy_set_header Accept-Encoding "gzip"; | 31 | proxy_set_header Accept-Encoding "gzip"; |
32 | - } | ||
32 | + } |
@@ -5,4 +5,4 @@ | @@ -5,4 +5,4 @@ | ||
5 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | 5 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
6 | ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:DES-CBC3-SHA"; | 6 | ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:DES-CBC3-SHA"; |
7 | ssl_session_tickets off; | 7 | ssl_session_tickets off; |
8 | - ssl_session_cache shared:SSL:10m; | ||
8 | + ssl_session_cache shared:SSL:10m; |
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 | + # } | ||
225 | + | ||
226 | + location ^~ /product/pro_ { | ||
227 | + return 301 http://item.m.yohobuy.com$request_uri; | ||
228 | + } | ||
221 | 229 | ||
222 | - location =/brand/index/about{ | ||
223 | - return 301 https://$host$request_uri; | ||
224 | - } |
1 | - location ^~ /passport/login/wechat/ { | ||
2 | - proxy_redirect off; | ||
3 | - proxy_pass http://yohobuywap-node; | ||
4 | - proxy_set_header Host $host; | ||
5 | - proxy_set_header X-Real-IP $remote_addr; | ||
6 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
7 | - proxy_set_header Accept-Encoding "gzip"; | ||
8 | - } | ||
9 | 1 | ||
10 | - location ^~ /activity { | ||
11 | - proxy_redirect off; | ||
12 | - proxy_pass http://yohobuywap-node; | ||
13 | - proxy_set_header Host $host; | ||
14 | - proxy_set_header X-Real-IP $remote_addr; | ||
15 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
16 | - proxy_set_header Accept-Encoding "gzip"; | ||
17 | - } | 2 | +location ^~ /passport/login/wechat/ { |
3 | + proxy_redirect off; | ||
4 | + proxy_pass http://yohobuywap-node; | ||
5 | + proxy_set_header Host $host; | ||
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"; | ||
9 | +} | ||
18 | 10 | ||
19 | - location = /coupon/index { | ||
20 | - return 301 /activity/coupon?$query_string; | ||
21 | - } | 11 | +location ^~ /activity { |
12 | + proxy_redirect off; | ||
13 | + proxy_pass http://yohobuywap-node; | ||
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"; | ||
18 | +} | ||
22 | 19 | ||
23 | - location ^~ /product/sale/ { | ||
24 | - proxy_redirect off; | ||
25 | - proxy_pass http://yohobuywap-node; | ||
26 | - proxy_set_header Host $host; | ||
27 | - proxy_set_header X-Real-IP $remote_addr; | ||
28 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
29 | - proxy_set_header Accept-Encoding "gzip"; | ||
30 | - } | ||
31 | 20 | ||
32 | - location ^~ /guang/star/ { | ||
33 | - proxy_redirect off; | ||
34 | - proxy_pass http://yohobuywap-node; | ||
35 | - proxy_set_header Host $host; | ||
36 | - proxy_set_header X-Real-IP $remote_addr; | ||
37 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
38 | - proxy_set_header Accept-Encoding "gzip"; | ||
39 | - } | 21 | +location ^~ /product/sale/ { |
22 | + proxy_redirect off; | ||
23 | + proxy_pass http://yohobuywap-node; | ||
24 | + proxy_set_header Host $host; | ||
25 | + proxy_set_header X-Real-IP $remote_addr; | ||
26 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
27 | + proxy_set_header Accept-Encoding "gzip"; | ||
28 | +} | ||
40 | 29 | ||
30 | +location ^~ /guang/star/ { | ||
31 | + proxy_redirect off; | ||
32 | + proxy_pass http://yohobuywap-node; | ||
33 | + proxy_set_header Host $host; | ||
34 | + proxy_set_header X-Real-IP $remote_addr; | ||
35 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
36 | + proxy_set_header Accept-Encoding "gzip"; | ||
37 | +} | ||
41 | 38 | ||
42 | - location ^~ /product/outlet/ { | ||
43 | - proxy_redirect off; | ||
44 | - proxy_pass http://yohobuywap-node; | ||
45 | - proxy_set_header Host $host; | ||
46 | - proxy_set_header X-Real-IP $remote_addr; | ||
47 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
48 | - proxy_set_header Accept-Encoding "gzip"; | ||
49 | - } | ||
39 | + | ||
40 | +location ^~ /product/outlet/ { | ||
41 | + proxy_redirect off; | ||
42 | + proxy_pass http://yohobuywap-node; | ||
43 | + proxy_set_header Host $host; | ||
44 | + proxy_set_header X-Real-IP $remote_addr; | ||
45 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
46 | + proxy_set_header Accept-Encoding "gzip"; | ||
47 | +} |
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"; | ||
9 | + } | ||
1 | 10 | ||
2 | - #app show help page | ||
3 | - location =/help/shareorder.html { | ||
4 | - root /Data/PE/yohobuy_H5/assets; | ||
5 | - expires 7d; | ||
6 | - } | ||
7 | - | ||
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; |
27 | proxy_set_header X-Real-IP $remote_addr; | 33 | proxy_set_header X-Real-IP $remote_addr; |
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,8 +23,7 @@ | @@ -23,8 +23,7 @@ | ||
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; | ||
29 | - expires 7d; | ||
30 | - } | ||
27 | + root /Data/PE/yohobuy_H5/assets; | ||
28 | + expires 7d; | ||
29 | + } |
@@ -6,53 +6,34 @@ server | @@ -6,53 +6,34 @@ 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 | - # app | ||
10 | - include vhosts/location/yohobuywap_app.conf; | ||
11 | - | ||
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 | - } | ||
21 | - | ||
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"; | ||
29 | - } | ||
30 | - | ||
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 | - # } | 9 | + # old idc |
10 | + include vhosts/location/yohobuywap_idc.conf; | ||
11 | + # app | ||
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; | ||
39 | 19 | ||
40 | - location ^~ /coupon { | ||
41 | - proxy_redirect off; | ||
42 | - proxy_pass http://yohobuy; | ||
43 | - proxy_set_header Host $host; | ||
44 | - proxy_set_header X-Real-IP $remote_addr; | ||
45 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
46 | - proxy_set_header Accept-Encoding "gzip"; | ||
47 | - } | 20 | + #https flag, 1 means HTTPS, 0 means HTTP |
21 | + set $httpsFlag 0; | ||
48 | 22 | ||
49 | - # others http 301 redirect https | ||
50 | - location / { | ||
51 | - return 301 https://m.yohobuy.com$request_uri; | ||
52 | - } | 23 | + location / { |
24 | + if ($httpsFlag = 1) { | ||
25 | + return 301 https://$host$request_uri; | ||
26 | + } | ||
27 | + | ||
28 | + proxy_redirect off; | ||
29 | + proxy_pass http://yohobuy; | ||
30 | + proxy_set_header Host $host; | ||
31 | + proxy_set_header X-Real-IP $remote_addr; | ||
32 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
33 | + proxy_set_header Accept-Encoding "gzip"; | ||
34 | + } | ||
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; |
@@ -69,26 +53,60 @@ server | @@ -69,26 +53,60 @@ server | ||
69 | # old idc | 53 | # old idc |
70 | include vhosts/location/yohobuywap_idc.conf; | 54 | include vhosts/location/yohobuywap_idc.conf; |
71 | # app | 55 | # app |
72 | - include vhosts/location/yohobuywap_app.conf; | ||
73 | - # php | ||
74 | - include vhosts/location/yohobuywap_php.conf; | ||
75 | - # node | ||
76 | - include vhosts/location/yohobuywap_node.conf; | 56 | + include vhosts/location/yohobuywap_app.conf; |
57 | + # php | ||
58 | + include vhosts/location/yohobuywap_php.conf; | ||
59 | + # node | ||
60 | + include vhosts/location/yohobuywap_node.conf; | ||
61 | + # static file | ||
62 | + include vhosts/location/yohobuywap_static.conf; | ||
63 | + | ||
64 | + #https flag, 1 means HTTPS, 0 means HTTP | ||
65 | + set $httpsFlag 0; | ||
66 | + | ||
67 | + location / { | ||
68 | + if ($httpsFlag = 0) { | ||
69 | + return 301 http://$host$request_uri; | ||
70 | + } | ||
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"; | ||
77 | + } | ||
78 | +} | ||
79 | + | ||
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; | ||
88 | + | ||
77 | # static file | 89 | # static file |
78 | include vhosts/location/yohobuywap_static.conf; | 90 | include vhosts/location/yohobuywap_static.conf; |
79 | 91 | ||
80 | - #for we chat pay | ||
81 | - location =/home/orders/pay{ | ||
82 | - return 301 http://$host$request_uri; | ||
83 | - } | ||
84 | - location =/shopping/pay/wechatwapapi { | ||
85 | - return 301 http://$host$request_uri; | 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"; | ||
86 | } | 100 | } |
87 | 101 | ||
88 | - #location =/shopping/pay/aliwapreturn { | ||
89 | - # return 301 http://$host$request_uri; | ||
90 | - #} | ||
91 | - | 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,9 +117,22 @@ server | @@ -99,9 +117,22 @@ 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 | ||
103 | - location / { | ||
104 | - return 301 https://$host$request_uri; | 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 | + | ||
126 | + location / { | ||
127 | + if ($httpsFlag = 1) { | ||
128 | + return 301 https://$host$request_uri; | ||
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"; | ||
105 | } | 136 | } |
106 | } | 137 | } |
107 | 138 | ||
@@ -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 | ||
@@ -126,35 +156,40 @@ server | @@ -126,35 +156,40 @@ server | ||
126 | include vhosts/location/yohobuywap_static.conf; | 156 | include vhosts/location/yohobuywap_static.conf; |
127 | 157 | ||
128 | # idc old proxy. while login to write memcache and cookie (if need?) | 158 | # idc old proxy. while login to write memcache and cookie (if need?) |
129 | - location ^~ /Passport/session { | ||
130 | - access_log /Data/logs/access.m.yohobuy.com.log fenxi; | ||
131 | - proxy_redirect off; | ||
132 | - proxy_pass http://yohobuy_idc; | ||
133 | - proxy_set_header Host mapi.yohobuy.com; | ||
134 | - proxy_set_header X-Real-IP $remote_addr; | ||
135 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
136 | - proxy_set_header Accept-Encoding "gzip"; | ||
137 | - } | ||
138 | - | ||
139 | - # guang rss | ||
140 | - location ^~ /rss { | ||
141 | - proxy_redirect off; | ||
142 | - proxy_pass http://yohobuy; | ||
143 | - proxy_set_header Host $host; | ||
144 | - proxy_set_header X-Real-IP $remote_addr; | ||
145 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
146 | - proxy_set_header Accept-Encoding "gzip"; | 159 | + location ^~ /Passport/session { |
160 | + access_log /Data/logs/access.m.yohobuy.com.log fenxi; | ||
161 | + proxy_redirect off; | ||
162 | + proxy_pass http://yohobuy_idc; | ||
163 | + proxy_set_header Host mapi.yohobuy.com; | ||
164 | + proxy_set_header X-Real-IP $remote_addr; | ||
165 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
166 | + proxy_set_header Accept-Encoding "gzip"; | ||
167 | + } | ||
168 | + # guang rss | ||
169 | + location ^~ /rss { | ||
170 | + proxy_redirect off; | ||
171 | + proxy_pass http://yohobuy; | ||
172 | + proxy_set_header Host $host; | ||
173 | + proxy_set_header X-Real-IP $remote_addr; | ||
174 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
175 | + proxy_set_header Accept-Encoding "gzip"; | ||
147 | } | 176 | } |
148 | 177 | ||
149 | - location / { | ||
150 | - proxy_redirect off; | ||
151 | - proxy_pass http://yohobuy; | ||
152 | - proxy_set_header Host $host; | ||
153 | - proxy_set_header X-Real-IP $remote_addr; | ||
154 | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
155 | - proxy_set_header Accept-Encoding "gzip"; | 178 | + #https flag, 1 means HTTPS, 0 means HTTP |
179 | + set $httpsFlag 0; | ||
180 | + | ||
181 | + location / { | ||
182 | + if ($httpsFlag = 0) { | ||
183 | + return 301 http://$host$request_uri; | ||
184 | + } | ||
185 | + proxy_redirect off; | ||
186 | + proxy_pass http://yohobuy; | ||
187 | + proxy_set_header Host $host; | ||
188 | + proxy_set_header X-Real-IP $remote_addr; | ||
189 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
190 | + proxy_set_header Accept-Encoding "gzip"; | ||
191 | + } | ||
156 | } | 192 | } |
157 | -} | ||
158 | 193 | ||
159 | server | 194 | server |
160 | { | 195 | { |
@@ -174,9 +209,9 @@ server | @@ -174,9 +209,9 @@ 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; |
181 | 216 | ||
182 | ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/m.yohobuy.pem; | 217 | ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/m.yohobuy.pem; |
@@ -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 | } |
script/nginx/conf/vhosts/yohobuywap_nohttps.conf
→
script/nginx/conf/vhosts/yohobuywap.httpsbak.conf
@@ -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"; | ||
88 | - } | ||
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"; | ||
97 | - } | ||
98 | - | ||
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 | - } | 80 | + #for we chat pay |
81 | + location =/home/orders/pay{ | ||
82 | + return 301 http://$host$request_uri; | ||
83 | + } | ||
84 | + location =/shopping/pay/wechatwapapi { | ||
85 | + return 301 http://$host$request_uri; | ||
86 | + } | ||
87 | + | ||
88 | + #location =/shopping/pay/aliwapreturn { | ||
89 | + # return 301 http://$host$request_uri; | ||
90 | + #} | ||
116 | 91 | ||
117 | } | 92 | } |
118 | 93 |
-
Please register or login to post a comment