forked from bcho/vinko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vinko.nginx.conf
43 lines (35 loc) · 1 KB
/
vinko.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
server {
listen 80;
listen [::]80;
server_name vinko;
root /home/hbc/workshop/localhost/vinko/public;
index index.php index.html;
autoindex on;
error_page 404 /index.php;
access_log /home/hbc/workshop/localhost/vinko/app/storage/access.log;
error_log /home/hbc/workshop/localhost/vinko/app/storage/error.log;
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
if ($host ~* ^www\.(.*)) {
set $host_without_www $1;
rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}
if ($request_uri ~* index/?$) {
rewrite ^/(.*)/index/?$ /$1 permanent;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}