-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx_app.conf
54 lines (50 loc) · 1.38 KB
/
nginx_app.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
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to index.php
rewrite ^(.*)$ /index.php/$1 last;
}
location ~ ^/index\.php(/|$) {
try_files @heroku-fcgi @heroku-fcgi;
# ensure that /index.php isn't accessible directly, but only through a rewrite
internal;
}
# Caching
location ~* \.(ico|jpg|webp|jpeg|gif|css|png|js|ico|bmp|zip|woff|woff2)$ {
add_header Pragma public;
add_header Cache-Control "public";
expires 7d;
}
location ~* \.(php|html)$ {
add_header Pragma public;
add_header Cache-Control "public";
expires 1d;
}
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_min_length 1k;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text/plain
text/javascript
text/css
text/xml
application/json
application/javascript
application/atom+xml
application/rss+xml
application/x-javascript
application/xml
application/xhtml+xml
application/x-font-ttf
image/svg+xml
#
application/csv
font/woff
font/woff2
font/ttf
;