How in Nginx to do rewrite without changing URL in address bar -



How in Nginx to do rewrite without changing URL in address bar -

i've been trying rewrite in nginx: domain.com/one/two -> onetwo.domain.com. url user sees should not changed in address bar.

this code not work correctly - changes url in address bar

rewrite ^/one/two/ http://onetwo.domain.com/ last;

what solution must there? thanks.

this isn't possible, because you're changing hostnames. browser security tied it, webserver configuration.

you can rewrite urls within same hostname, changing hostnames requires redirect or using frame.

nginx

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -