Forum: NGINX help with nginx configuration

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.
95d204e259468b9213075b426bd1be01?d=identicon&s=25 just starting (Guest)
on 2008-11-24 13:06
(Received via mailing list)
Hi,

Please consider this following scenario.

I have 2 servers(1 jetty and the other is apache) with nginx as proxy
servers to both.

I forward all the jsp queries to jetty and all the php queries to apache
httpd and serve the static content of both the servers by nginx.

Now the problem is there is one xml file "top.xml", generated by httpd
which
i must send the request to httpd and also i need to send all the request
to
*.xml to jetty(i have asked the dev team to make sure there is no
top.xml
file in jetty).

Can you suggest some configuration settings to achieve this.

Right now I have tried that for top.xml go to httpd and for *.xml go to
jetty, but clearly the rule with *.xml overrides the top.xml condition.

My question is how the rules in the conf file processed when it comes to
proxying the request to different servers.

Thanks,

Rakesh.
Fda08117336cfde6562315df04b976e8?d=identicon&s=25 Dave Cheney (Guest)
on 2008-11-24 13:23
(Received via mailing list)
Hi Rakesh,

The rules for location matching are layed out here

http://wiki.codemongers.com/NginxHttpCoreModule#location

I think what you are trying to do might look like this

server {

   server_name ...

   include proxy.conf;

   # match exactly /top.xml
   location = /top.xml {
      proxy_pass http://apache;
   }

   # match *.xml {
   location ~* \.xml {
      proxy_pass http://jetty
   }

}

Cheers

Dave
95d204e259468b9213075b426bd1be01?d=identicon&s=25 just starting (Guest)
on 2008-11-25 10:57
(Received via mailing list)
I will try it and post my findings soon.

Thanks,

Rakesh.
This topic is locked and can not be replied to.