-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
54 lines (45 loc) · 1.07 KB
/
nginx.conf
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
daemon off;
error_log stderr warn;
pid /var/run/nginx.pid;
worker_processes 1;
events {
worker_connections 1024;
}
http {
access_log off;
log_not_found off;
sendfile on;
include /etc/nginx/mime.types;
include /etc/nginx/fastcgi.conf;
default_type application/octet-stream;
tcp_nopush on;
client_max_body_size 512M;
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
disable_symlinks off;
location = /robots.txt {
allow all;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 360d;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}