Welcome! Log In Create A New Profile

Advanced

Mixing proxy_pass and $request_filename

Posted by nwl 
nwl
Mixing proxy_pass and $request_filename
August 01, 2013 06:26AM
Hi there to everybody.

At our company where we are hosting many online apps, are right now in the process of switching from Apache2 to nginx, however we have some problems with fine-tuning configuration.

For webserver a nginx is used, where requests are being proxied to Tomcat backends, like this:

location / {
proxy_pass http://localhost:8120/uav/;
}

location /um/ {
proxy_pass http://localhost:8120/um/;
}

location /ns/ {
proxy_pass http://localhost:8120/ns/;
}

Regarding the proxies, everything works as expected. Now i need to set up that when comes a request for video file (.mp4), it has to be served from another location (local filesystem) and not through proxy.

A request looks like:

http://our.domain.com/ns/rest/content/video/Video_File.mp4

as you can see, the request goes to /ns/ "subdir", which is proxied by default. Now i need to match that .mp4 extension and deliver it from another source, like /home/videos/Video_File.mp4

I messed around with $request_filename, but didn't work as expected.

Any help is much appreciated.

Thanks and best regards.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready