Rerouting based on content-type of request

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

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

location ~*/(keyword){

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
these two urls? I’m using Nginx 1.6.2.


Posted at Nginx Forum:,260830,260830#msg-260830

Close enough:,239473,239473#msg-239473

Posted at Nginx Forum:,260830,260831#msg-260831

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs