-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
48 lines (40 loc) · 1.12 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
server
{
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
index index.html index.htm index.php default.html default.htm default.php;
root /var/www/html;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ .php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
include snippets/fastcgi-php.conf;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
#error_page 404 = /404.php;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
#access_log off;
error_log /var/log/nginx/default.error.log;
error_page 404 /404.php;
}