Answer the question
In order to leave comments, you need to log in
Why does Nginx lose part of the URI on 301 redirects?
Why does Nginx lose part of the URI on 301 redirects?
I do something like this:
location /grid {
return 301 https://$server_name$request_uri;
}
Answer the question
In order to leave comments, you need to log in
because it's better to do this:
rewrite ^/(.*)$ https://$server_name/$1 permanent;
Try like this. This option works for me.
For example, I use it to redirect all requests from the domain.ru domain to the www.domain.ru domain. In this case, the line with the address and parameters after the redirect is completely preserved.
location / {
rewrite ^(.*)$ http://www.domain.ru$1 permanent;
}
location /grid {
return 503;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question