Welcome! Log In Create A New Profile

Advanced

Re: URI rewrite with port number

Maxim Dounin
December 19, 2010 04:22PM
Hello!

On Sun, Dec 19, 2010 at 04:10:42PM -0500, microchip wrote:

> 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;
> }

server {
listen 8080 default;
server_name _;
rewrite ^ http://somedomain.com:8080$request_uri? permanent;
}

server {
listen 8080;
server_name somedomain.com;
...
}

See here for more details:

http://nginx.org/en/docs/http/request_processing.html

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

URI rewrite with port number

microchip December 19, 2010 04:10PM

Re: URI rewrite with port number

Maxim Dounin December 19, 2010 04:22PM

Re: URI rewrite with port number

microchip December 19, 2010 04:43PM

Re: URI rewrite with port number

microchip December 22, 2010 12:43PM

Re: URI rewrite with port number

microchip December 22, 2010 12:44PM

Re: URI rewrite with port number

Maxim Dounin December 22, 2010 01:12PM

Re: URI rewrite with port number

microchip December 22, 2010 01:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 96
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready