P
P
Pavel Ivanov2014-07-08 19:19:54
Nginx
Pavel Ivanov, 2014-07-08 19:19:54

How to reset cached redirect in nginx?

Set up a redirect from server.com to www.server.com in this way

server {
    server_name “~^(?!www\.).*” ;
    return 301 $scheme://www.$host$request_uri;
}

And now, when a request is made to www.server.com, it is redirected to www.www.server.com. I have already removed these settings from the config, but the redirection remains.
What could be the reason?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2014-07-08
@eastywest

Also, restart the browser, because 301 redirects can be cached.

D
Dmitry Entelis, 2014-07-08
@DmitriyEntelis

sudo service nginx reload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question