Местоположение regex действие странного на NGINX

Предложение! Или используйте инструмент сравнения с поддержкой XML как BeyondCompare, или как веб-Инструмент Развертывания (-verb:sync-whatif) для сравнения конфигураций, особенно на applicationhost.config уровне.

0
задан 7 February 2014 в 16:53
1 ответ

Ok, finally got it!

I messed up my regex :'(

Here is the final configuration file which is perfectly working as intended :D

server {
    listen  80;
    server_name hostname.domaine.tld;

    access_log /var/log/nginx/hostname.access.log;
    error_log /var/log/nginx/hostname.error.log;

    include errors.conf;
    include proxy.conf;

    location ~ ^/$ {
        deny all;
    }

    location ~ ^/manager/(?<$uri>)$ {
        deny all;
    }

    location ~^/(?<$uri>)$ {
        proxy_pass http://recette/$uri;
    }
}

Indeed there were two issues, the first one is the "=" sign which need a perfect match. The second is the added (w+) which conflict with the already exising catch all regex provided by the (?) directive.

So, thanks to the viewer, and sorry for the disturb ^^

0
ответ дан 5 December 2019 в 14:27

Теги

Похожие вопросы