How can I stop nginx from responding to non-local requests? -


here's nginx file looks like. when browse server using ip, still the "welcome nginx!" page

server {     listen 127.0.0.1:9070;      root /var/www/[redacted]/public/;     index index.php index.html index.htm;     server_name [redacted];      location / {         try_files $uri $uri/ /index.php$is_args$args;         allow 127.0.0.1;         deny all;     }      # pass php scripts fastcgi server listening on /var/run/php5-fpm.sock     location ~ \.php$ {             fastcgi_pass unix:/var/run/php5-fpm.sock;             fastcgi_index index.php;             fastcgi_param script_filename $document_root$fastcgi_script_name;             include fastcgi_params;     } } 

i believe you'll find moving allow/deny server clause clear up:

server {     listen 127.0.0.1:9070;      root /var/www/[redacted]/public/;     index index.php index.html index.htm;     server_name [redacted];      location / {         try_files $uri $uri/ /index.php$is_args$args;         allow 127.0.0.1;         deny all;     } 

becomes:

server {     listen 127.0.0.1:9070;      root /var/www/[redacted]/public/;     index index.php index.html index.htm;     server_name [redacted];      allow 127.0.0.1;     deny all;      location / {         try_files $uri $uri/ /index.php$is_args$args;     } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -