Answer the question
In order to leave comments, you need to log in
How to arrange location in nginx for "all other urls" case?
I have the following config:
location ^~ /api {
if ($http_cookie ~ 'sid'){
proxy_pass http://localhost:300;
break;
}
return 403;
}
location ^~ /auth {
proxy_pass http://localhost:300;
}
location / {
root barp;
set $page 'landing.html';
if ($http_cookie ~ 'sid'){
set $page '/index.html';
}
try_files $page =500;
}
Answer the question
In order to leave comments, you need to log in
I will suggest so.
This configuration works for me
location ~ ^/auth(.*)$ {
proxy_pass http://localhost:300;
}
location ~^ /api(.*)$ {
if ($http_cookie ~ 'sid'){
proxy_pass http://localhost:300;
break;
}
return 403;
}
they come there and look at the nginx logs and everything will become clear to you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question