Understood Diretive Location and Regex (concept question).

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Understood Diretive Location and Regex (concept question).

Labs Ocozzi

Dears, in me Lab i have nginx work fine, but i dont understood the diretive location with regex "~ /\. " "~*  \." and
"~ \.php$" bellow examples in me enviroment.



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
       location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       }



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
-- 
Att,
BR-RJ.
Togy Silva Ocozzy
e-mail: [hidden email]
LABS OCOZZI PE.



Avast logo

Este email foi escaneado pelo Avast antivírus.
www.avast.com



_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Understood Diretive Location and Regex (concept question).

Anoop Alias
location ~ /\. 

regex location for /.   
The back slash before dot is just an escape char as dot has special meaning in regex 
---------------------------------------------------

location ~ \.php$

regex location for anything ending in .php 
Here again the backslash before dot serve as an escape 

On Wed, Sep 19, 2018 at 4:15 PM Labs Ocozzi <[hidden email]> wrote:

Dears, in me Lab i have nginx work fine, but i dont understood the diretive location with regex "~ /\. " "~*  \." and
"~ \.php$" bellow examples in me enviroment.



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
       location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       }



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
-- 
Att,
BR-RJ.
Togy Silva Ocozzy
e-mail: [hidden email]
LABS OCOZZI PE.



Avast logo

Este email foi escaneado pelo Avast antivírus.
www.avast.com


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx


--
Anoop P Alias 


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Understood Diretive Location and Regex (concept question).

Labs Ocozzi

tks Anoop


Em 19/09/2018 07:51, Anoop Alias escreveu:
location ~ /\. 

regex location for /.   
The back slash before dot is just an escape char as dot has special meaning in regex 
---------------------------------------------------

location ~ \.php$

regex location for anything ending in .php 
Here again the backslash before dot serve as an escape 

On Wed, Sep 19, 2018 at 4:15 PM Labs Ocozzi <[hidden email]> wrote:

Dears, in me Lab i have nginx work fine, but i dont understood the diretive location with regex "~ /\. " "~*  \." and
"~ \.php$" bellow examples in me enviroment.



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
       location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       }



       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
-- 
Att,
BR-RJ.
Togy Silva Ocozzy
e-mail: [hidden email]
LABS OCOZZI PE.



Avast logo

Este email foi escaneado pelo Avast antivírus.
www.avast.com


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx


--
Anoop P Alias 



_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

-- 
Att,
BR-RJ.
Togy Silva Ocozzy
e-mail: [hidden email]
LABS OCOZZI PE.

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx