Authored by 梁志锋

nginx修改备份

#old idc
# location = /erp2goods {
# proxy_redirect off;
# proxy_pass http://yohobuy-old-www;
# 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_set_header Accept-Encoding "gzip";
# }
location = /passport/auth/signin {
proxy_redirect off;
proxy_pass http://yohobuy-old-www;
... ...
... ... @@ -31,3 +31,30 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /common/passport {
proxy_redirect off;
proxy_pass http://yohobuy-pc;
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_set_header Accept-Encoding "gzip";
}
location ^~ /Passport/session/index {
proxy_redirect off;
proxy_pass http://yohobuy-old-www;
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_set_header Accept-Encoding "gzip";
}
location ^~ /home/address/area {
proxy_redirect off;
proxy_pass http://yohobuy-pc;
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_set_header Accept-Encoding "gzip";
}
\ No newline at end of file
... ...
... ... @@ -19,15 +19,6 @@ server
# node
include vhosts/location/yohobuypc_node.conf;
location = /index.html {
return 301 http://www.yohobuy.com/;
}
location ^~ /resource/getbanner {
rewrite /resource/getbanner(.*)$ https://www.yohobuy.com/common/getbanner$1 permanent;
}
location ~* /special_(\d+)_(.*)\.html$ {
proxy_redirect off;
proxy_pass http://yohobuy-old-www;
... ... @@ -46,8 +37,25 @@ server
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /home/returns {
proxy_redirect off;
proxy_pass http://yohobuy-pc;
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_set_header Accept-Encoding "gzip";
}
location = /index.html {
return 301 http://www.yohobuy.com/;
}
location ^~ /resource/getbanner {
rewrite /resource/getbanner(.*)$ https://www.yohobuy.com/common/getbanner$1 permanent;
}
#https flag, 1 means HTTPS, 0 means HTTP
set $httpsFlag 1;
set $httpsFlag 0;
location / {
if ($httpsFlag = 1) {
... ... @@ -122,6 +130,10 @@ server
return 301 http://$host$request_uri;
}
location ^~ /home/returns {
return 301 http://$host$request_uri;
}
location = /index.html {
return 301 http://www.yohobuy.com/;
}
... ... @@ -131,7 +143,7 @@ server
}
#https flag, 1 means HTTPS, 0 means HTTP
set $httpsFlag 1;
set $httpsFlag 0;
location / {
if ($httpsFlag = 0) {
... ... @@ -234,21 +246,22 @@ server
include vhosts/location/yohobuypc_static.conf;
}
#server
#{
# listen 80;
# listen 443 ssl;
#
# server_name yohobuy.com;
# ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/pc/server.pem;
# ssl_certificate_key /Data/local/nginx-1.8.0/conf/ssl/pc/server.key;
#
# # access_log /Data/logs/nginx/access_pc.yohobuy.com.log fenxi;
# error_log /Data/logs/error_pc.yohobuy.com.log warn;
# location = / {
# return 301 https://www.yohobuy.com/;
# }
#}
server
{
listen 80;
#listen 443 ssl;
server_name yohobuy.com;
#ssl_certificate /Data/local/nginx-1.8.0/conf/ssl/pc/server.pem;
#ssl_certificate_key /Data/local/nginx-1.8.0/conf/ssl/pc/server.key;
# access_log /Data/logs/nginx/access_pc.yohobuy.com.log fenxi;
error_log /Data/logs/error_pc.yohobuy.com.log warn;
location = / {
return 301 http://www.yohobuy.com/;
}
}
server
{
... ... @@ -268,6 +281,7 @@ server
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
proxy_set_header http_referer $http_referer;
}
}
... ... @@ -283,6 +297,7 @@ server
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
proxy_set_header http_referer $http_referer;
}
}
... ...