Welcome! Log In Create A New Profile

Advanced

Condensing Location Directives

July 23, 2012 01:37PM
I have this setup for my location directives

location /css/ {
proxy_pass http://127.0.0.1:8080/css/;
}

location /js/ {
proxy_pass http://127.0.0.1:8080/js/;
}

It seems a bit repetitive to me, is it possible to do something like this.

location /css/, /js/ {
proxy_pass http://127.0.0.1:8080/$1;
}

Where you can have one block process multiple locations, then the variable $1, copies the location defined into the proxy_pass URL? I might have about 10-20 and it would be easier to have one block then 20.
Subject Author Posted

Condensing Location Directives

arosolino July 23, 2012 01:37PM

Re: Condensing Location Directives

locojohn July 27, 2012 09:25AM

Re: Condensing Location Directives

arosolino July 27, 2012 09:49AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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