-
Notifications
You must be signed in to change notification settings - Fork 9
/
statamic.nginx.conf
64 lines (50 loc) · 1.6 KB
/
statamic.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
63
64
server {
listen 8000;
root /var/www/statamic-site;
# ssl_protocols TLSv1.2;
# Increase Nginx upload size limit to 12MB
client_max_body_size 12M;
index index.html index.htm index.php;
charset utf-8;
# Static cache reverse proxy
# location = / {
# try_files /static/index.html /index.php?$query_string;
# }
location / {
try_files $uri $uri/ /static/$uri /static/$uri/index.html /static/ $uri /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/example.com-error.log error;
error_page 404 /index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_read_timeout 300;
}
# Block access to hidden files (except the /.well-known/ dir)
location ~ /(?!.well-known)(\.)\w+ {
deny all;
}
# Block access to content/data files
location ~* /(.*)\.(?:md|yaml|textile)$ {
deny all;
return 404;
}
# Block access to the Statamic app
location ^~ /statamic {
deny all;
return 404;
}
# Enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
gzip_vary on;
}