Welcome! Log In Create A New Profile

Advanced

Rerouting based on content-type of request

August 06, 2015 03:04PM
I'm having a reverse-proxied Nginx server. I wanted to know if it is possible to redirect the request in Nginx based on the content-type of the request?

Right now, I'm checking the URL for a keyword, and based on that, I redirect the request. So it is something like this:

location ~*/(keyword){
proxy_pass http://127.0.0.1:6565;
}

But now I have another URL having the same keyword. However, the content-type of the request will be 'application/json', and I need to forward that request to port 8080. Is it possible to differentiate between these two urls? I'm using Nginx 1.6.2.

Thanks.
Subject Author Posted

Rerouting based on content-type of request

sudharshanr August 06, 2015 03:04PM

Re: Rerouting based on content-type of request

itpp2012 August 06, 2015 03:47PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 151
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