Answer the question
In order to leave comments, you need to log in
How to create the following condition in nginx?
If the user requests the site address "/" and the sid cookie exists, then redirect to "/account/"
If the user requests any other page and the sid cookie does NOT exist, then redirect to "/"
Here is my code:
map "$cookie_sid:$request_filename" $path {
default $request_filename;
":~^/.+" "/";
"~.+:/" "/account/";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question