Welcome! Log In Create A New Profile

Advanced

trailing slash at end URL with nginx as a reverse proxy for multiple website

Nguyen Hai Nam
November 20, 2011 03:12AM
Hi,

I'm running OpenIndiana 151a server then now I'd like to build the web
service with nginx. Briefly, my scenario is: one central server installed a
few website in virtual machines, and there is a different real machine that
stores static contents. I want nginx in central server will be the reverse
proxy (get idea from
http://tumblr.intranation.com/post/766288369/using-nginx-reverse-proxy).

For example, if someone open website a.com, it will be redirected to
10.0.0.2:8001, and if other go to b.com it will be redirected to
10.0.0.3:8001, etc ...

server {
listen 80;
server_name a.com;

location / {
proxy_pass http://10.0.0.2:8001;
proxy_redirect off;
server_name_in_redirect off;
}
}

Nginx works fine, but I don't know how to rewrite/redirect the URL looks
like: http://a.com/something becomes http://a.com/something/

If someone open the link http://a.com/something nginx can't serve it then
return the error message that says "http://a.com:8001/something"
unreachable.

If you have any advice, please tell. It's highly appreciated.

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

trailing slash at end URL with nginx as a reverse proxy for multiple website

Nguyen Hai Nam November 20, 2011 03:12AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

António P. P. Almeida November 20, 2011 03:38AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

António P. P. Almeida November 20, 2011 03:42AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Edho Arief November 20, 2011 04:14AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Igor Sysoev November 20, 2011 04:18AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Nguyen Hai Nam November 20, 2011 08:58AM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Calin Don November 20, 2011 02:08PM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Nguyen Hai Nam November 20, 2011 08:50PM

Re: trailing slash at end URL with nginx as a reverse proxy for multiple website

Nguyen Hai Nam November 21, 2011 02:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready