Forum: NGINX how to configure nginx as a reverse proxy like this?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
yong xue (Guest)
on 2008-10-28 05:13
(Received via mailing list)
i want to use nginx as a reverse proxy.

the back end is some storages. lets say storage1, storage2.

there are two service running in each storage,
 one for upload on port 80, and one for download on port 81
so with nginx i want
http://hostname/storage1/upload/filename  forward to storage1 port80
 http://hostname/storage1/download/filename  forward to storage1 port81
 http://hostname/storage2/upload/filename  forward to storage2 port80
 http://hostname/storage2/download/filename  forward to storage2 port81

how can i get this?

thx in advance.
Delta Y. (Guest)
on 2008-10-28 08:33
(Received via mailing list)
Please try:


server{
server_name your_server_name;

location/storage1/upload {
  proxy_pass http://storage1:80;
}

location/storage1/download {
  proxy_pass http://storage1:81;
}
location/storage2/upload {
  proxy_pass http://storage2:80;
}

location/storage2/download {
  proxy_pass http://storage2:81;
}

....

}

2008/10/28 yong xue <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.