Welcome! Log In Create A New Profile

Advanced

Wildcard in location directive

November 15, 2016 07:04AM
Gents,

I am trying to setup location block which has wildcard 'inside' regex. Here is what I think should work:

location ~ /documents/(.*)static=false$ {
proxy_pass http://upstream;
}

location /documents {
try_files $uri /test.html;
}
location = /test.html {
expires 30s;
}

Unfortunately first location block is not working for me. My testing URL is domain.com/documents/23/582ad23330d63a078c967bc3/-1476160403/DUH/POI/2016-12-13/params?variable=my&var=0&many=other-variables&static=false .
As you can see URI is quite complex, that is why I want to use wildcard.

Any idea why it is not working and how to fix this?

Thank you in advance.
Subject Author Posted

Wildcard in location directive

piotr.pawlowski November 15, 2016 07:04AM

Re: Wildcard in location directive

Francis Daly November 15, 2016 07:40AM

Re: Wildcard in location directive

piotr.pawlowski November 15, 2016 08:03AM

Re: Wildcard in location directive

Francis Daly November 15, 2016 01:34PM

Re: Wildcard in location directive

piotr.pawlowski November 15, 2016 02:57PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready