-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx_default
More file actions
60 lines (50 loc) · 1.82 KB
/
nginx_default
File metadata and controls
60 lines (50 loc) · 1.82 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/html;
index index.html index.htm index.php;
access_log off;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.html /index.php;
}
location ~ ^/tmp/(.*)$ {
deny all;
}
location ~ ^/log/(.*)$ {
deny all;
}
location ~ ^/backup/(.*)$ {
deny all;
}
location ~ \.sql$ {
deny all;
}
location ~ \.tar$ {
deny all;
}
location ~ \.gz$ {
deny all;
}
location ~ ^/(.*)ini$ {
deny all;
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_read_timeout 300;
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
}
}