Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx I'm not sure I fully understand the nginx location part.

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by ModeltogTossen, Jan 23, 2016.

Tags:
  1. ModeltogTossen

    ModeltogTossen I wish I could??

    313
    97
    28
    Dec 20, 2015
    Denmark
    Ratings:
    +143
    Local Time:
    9:13 AM
    1.9.12
    10.0.23
    Hi ..

    Got my site up and running and fine.. Then I did transfer my older forum over as at folder in my public root. And here is what I'm not fully understand..

    See - I got this in my nginx conf file for the site:

    Code:
            location /admin.php {
                    include /usr/local/nginx/conf/php_disabled_openbasedir.conf;
                    allow 127.0.0.1;
                    allow x.x.x.x;
                    deny all;
            }
    
            location /install/ {
                    include /usr/local/nginx/conf/php_disabled_openbasedir.conf;
                    allow 127.0.0.1;
                    allow x.x.x.x;
                    deny all;
            }
    
    And those is working as expected. Now, back to the transfered old site in the folder in public..


    Right below the /install/ part I did another part like this:

    Code:
            location /anotherforum/ {
                    include /usr/local/nginx/conf/php_disabled_openbasedir.conf;
                    allow 127.0.0.1;
                    allow x.x.x.x;
                    deny all;
            }
    
    Then I executed ngrestart - but if I go to the website/anotherforum/ - then I'm allowed and not as expected, not allowed.. I did come from another external IP not in the allow IP part..

    What is it I don't understand here - any hints on where to look?
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,237
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    5:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    maybe post the full vhost contents so we can see the proper context of everything