server listen 80 root usr share nginx domain com index index html inde

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
server {
listen 80;
root /usr/share/nginx/domain.com;
index index.html index.htm index.php;
server_name domain.com www.domain.com;
location / {
try_files $uri $uri/ /index.html;
}
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;
}
location ~wp-config.php
{ allow ip1;
allow ip2;
deny all; }
}