Welcome! Log In Create A New Profile

Advanced

Re: Static resource failed to pass through cookie

Aleksandar Lazic
August 10, 2019 04:48AM
Hi.

Am 09.08.2019 um 10:26 schrieb 姜伯洋:
> map $cookie_test_debug $forward_to_gray {
default 10.0.0.2;

I would suggest to add this entry according to the doc and remove the if blocks.

https://nginx.org/en/docs/http/ngx_http_map_module.html#map


>     # 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
Subject Author Posted

Static resource failed to pass through cookie

姜伯洋 August 09, 2019 04:28AM

Re: Static resource failed to pass through cookie

Aleksandar Lazic August 10, 2019 04:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready