Set location based on query arg

Francis Daly francis at
Thu Nov 10 22:19:53 UTC 2016

On Thu, Nov 10, 2016 at 03:04:43PM -0500, ulik wrote:

Hi there,

> Is it possible to set/modify location based on the query string arg from
> request?

The one-word answer is "no".

So the follow-up question is: what do you want to do?

> Here is the scenario:
> Request:
> Docroot: /var/www/example/abc/

What would you like nginx to do with that request, that somehow involves

Serve a specific file from the filesystem? Make a fastcgi request to an
upstream including a particular key/value pair? Something else?

> Request:
> Docroot: /var/www/example/xyz/

And what would you like nginx to do with *that* request, that is different
from the previous one?

Perhaps the thing that you want achieved, can be achieved somehow.

Francis Daly        francis at

More information about the nginx mailing list