I have a problem with my configuration, I use nginx/1.10.3, php5-fpm.
this is my default config location :
location / {
try_files $uri $uri/ =404;
allow 1.2.3.4; #my ip
allow 127.0.0.1;
allow 11.22.33.44; #server ip
deny all;
}
when I try to access 11.22.33.44 i have an 403 Forbidden:
2017/03/08 16:30:25 [error] 340#340: *3 access forbidden by rule, client: 1.2.3.4, server: _, request: "GET / HTTP/1.1", host: "11.22.33.44"
Thanks for your help !
Resolve, solution :
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
allow 127.0.0.1;
allow 1.2.3.4; #my ip
deny all;
}