nginx - How to stop location rewrite from changing browser URL -
i'm setting ghost instance in subdirectory, , want point root (/) static page. have in nginx conf.
location / { rewrite ^ /blog/about break; } location ^~ /blog { proxy_pass http://localhost:2368; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-forwarded-proto $scheme; proxy_buffering off; }
the news redirect root works, in user redirected right page (/blog/about). however, url address works. didn't expect happen rewrite, can me point out what's wrong here?
you need change 'break' 'last'.
the 'break' means not going try other location block after current one. i'm guessing application doing redirect @ point. logs should confirm this.
also, should use:
proxy_redirect off;
Comments
Post a Comment