Static resource failed to pass through cookie

2019-08-09 Thread
map $cookie_test_debug $forward_to_gray {
# forward to gray1
9cb88042edc55bf85c22e89cf880c63b 10.0.0.1;
}
location ~ ^/test/ {
root /data/www/project;
index index.html;
if ( $uri !~ (css|js)$ ) {
rewrite  ^.*$  /test/index.html  break;
}
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
try_files $uri $uri/ /index.php?$query_string;
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}
}


According to the above configuration, my php request can be routed through a 
cookie, but the static resource will report 404, I don't know if there is a 
problem with my configuration.







 ___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Static resource failed to pass through cookie

2019-08-08 Thread
map $cookie_test_debug $forward_to_gray {
# forward to gray1
9cb88042edc55bf85c22e89cf880c63b 10.0.0.1;
}
location ~ ^/test/ {
root /data/www/project;
index index.html;
if ( $uri !~ (css|js)$ ) {
rewrite  ^.*$  /test/index.html  break;
}
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
try_files $uri $uri/ /index.php?$query_string;
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}
}





___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Fw:Routing problems through cookies

2019-03-26 Thread


map $cookie_wpt_debug $forward_to_gray {
# When default is not specified, the default resulting value will be an 
empty string.
default "";
9cb88042edc55bf85c22e89cf880c63a 10.105.195.11;
}
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}


When I configure this, he can be routed normally.


map $cookie_wpt_debug $to_gray {
# When default is not specified, the default resulting value will be an 
empty string.
default "";
9cb88042edc55bf85c22e89cf880c63a 10.105.195.11;
}
if ( $to_gray != '' ) {
proxy_pass http://$to_gray$request_uri;
break;
}


When I configure this, he said that it can't be routed, I don't know why.





 






 ___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Routing problems through cookies

2019-03-26 Thread
map $cookie_wpt_debug $forward_to_gray {
# When default is not specified, the default resulting value will be an 
empty string.
default "";
9cb88042edc55bf85c22e89cf880c63a 10.105.195.11;
}
if ( $forward_to_gray != '' ) {
proxy_pass http://$forward_to_gray$request_uri;
break;
}


When I configure this, he can be routed normally.


map $cookie_wpt_debug $to_gray {
# When default is not specified, the default resulting value will be an 
empty string.
default "";
9cb88042edc55bf85c22e89cf880c63a 10.105.195.11;
}
if ( $to_gray != '' ) {
proxy_pass http://$to_gray$request_uri;
break;
}


When I configure this, he said that it can't be routed, I don't know why.





 ___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx