forked from sethkontny/simplet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
34 lines (28 loc) · 1.02 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
server {
listen 80;
server_name yourdomain.com;
root /var/www/yourdomain.com;
error_log /var/log/nginx/yourdomain.com notice;
access_log off;
index index.php index.html index.htm;
location / {
autoindex on;
try_files $uri $uri/ @extensionless-php;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(css)$ { expires 7d; }
location ~* \.(js)$ { expires 14d; }
location ~* \.(png|jpg|jpeg|gif|ico|svg)$ { expires 28d; }
location ~* \.(eot|woff|ttf)$ { expires 1y; }
}