Welcome! Log In Create A New Profile

Advanced

Re: Too many define location directive

April 23, 2017 10:08PM
Hi,

On 23/04/17 05:36, Dewangga Bachrul Alam wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hello!
>
> I got confused and no hint(s) about map directive co-exist with
> try_files directive. Is it right to think using map directive? Or any
> alternative?
>
> The goals is, I want to avoid many location like :
>
> ... snip ...
> index index.php;
> try_files $uri $uri/ /index.php?q=$uri&$args;
> root /var/www/api.domain.tld;
>
> location /v2 {
> try_files $uri $uri/ /v2/index.php?q=$uri&$args;
> }
>
> location /v3 {
> try_files $uri $uri/ /v3/index.php?q=$uri&$args;
> }
>
> location ~ \.php$ {
> fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
> ... rest fastcgi stuff there ...
> }
> ...
>
> That config above are works fine, but too many location "/v[0-9]+" in
> config file. So, if there are v4, v5, etc are exists in
> /var/www/api.domain.tld, the configuration won't change.
>
> Any helps are appreciate.
> Thanks.
>

use a map??

--
Steve Holdoway BSc(Hons) MIITP
https://www.greengecko.co.nz/
Linkedin: https://www.linkedin.com/in/steveholdoway
Skype: sholdowa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Too many define location directive

dewanggaba April 22, 2017 01:40PM

Re: Too many define location directive

GreenGecko April 23, 2017 10:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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