URI rewrite with port number

microchip nginx-forum at nginx.us
Wed Dec 22 21:20:06 MSK 2010


Maxim Dounin Wrote:
-------------------------------------------------------
> Hello!
> 
> On Wed, Dec 22, 2010 at 12:44:48PM -0500,
> microchip wrote:
> 
> > oops, forgot the add the rewrite ^
> > http://somedomain.com:8080$request_uri?
> permanent; in first server, but
> > it doesn't work
> 
> It won't as long as you still have "return 444;"
> before it.
> 
> Maxim Dounin
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx


yes, yes, I did a wrong paste of an older config, but even with the
below one, it still doesn't work for me, which has my head scratching

server {
listen *:8080 default_server;
server_name _;
rewrite ^ http://xxx.xxx.xxx:8080$request_uri? permanent;
}

server {
server_name xxx.xxx.xxx;
listen *:8080 rcvbuf=64k backlog=128;
limit_conn gulag 5;
charset utf-8;
access_log /var/log/nginx/xxx.access.log;
root /srv/www/htdocs/xxx.xxx.xxx;
location / {
index index.php;
}

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




More information about the nginx mailing list