URI rewrite with port number

microchip nginx-forum at nginx.us
Mon Dec 20 00:10:42 MSK 2010


Hi,

I'm trying to rewrite 'www.somedomain.com:8080' to 'somedomain.com:8080'
but when I use the below, it doesn't work. Any ideas? :)

if ($host != "somedomain.com:8080" ) {
    rewrite  ^/(.*)$  "http://somedomain.com:8080/$1"  permanent;
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,159859,159859#msg-159859




More information about the nginx mailing list