This repository has been archived by the owner on May 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
nginx.conf
62 lines (52 loc) · 1.4 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
55
56
57
58
59
60
61
62
server {
listen 80;
listen [::]:80;
root /path/to/fluid-mc-stats/;
index index.php index.html index.htm;
server_name domain.tld;
# Logging
access_log /path/to/logs/access.log;
error_log /path/to/logs/error.log warn;
# Deny hidden files.
location ~ /\. {
deny all;
}
location ~ ^/(inc\/version\.php|config\.php|inc\/security\.php|tmp) {
deny all;
}
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/([^/]*)(.*)$ /index.php?view=$1¶ms=$2 last;
}
##
# Example Subdirectory Install
# Other location blocks will need to be updated to show the new path too. This just shows the more difficult rewrite one.
##
#
#location /my/fmcs/install/path {
# try_files $uri $uri/ @rewrite;
#}
#
#location @rewrite {
# rewrite ^/my/fmcs/install/path/([^/]*)(.*)$ /my/fmcs/install/path/index.php?view=$1¶ms=$2 last;
#}
##
# Pass PHP files to FPM.
location ~* \.php(?:$|/) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Static File Caching?
location ~* \.(?:jpg|jpeg|png|gif|svg|ico|css|js)$ {
expires 30d;
}
}