File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 26
26
# Must read the body in 5 seconds.
27
27
client_body_timeout <%= ENV['NGINX_CLIENT_BODY_TIMEOUT'] || 5 %> ;
28
28
29
+ # CACHING
30
+ proxy_cache_path cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
31
+
29
32
# handle SNI
30
33
proxy_ssl_server_name on;
31
34
# resolver needs to be set because we're using dynamic proxy_pass
@@ -44,6 +47,11 @@ http {
44
47
45
48
port_in_redirect off;
46
49
50
+ gzip on;
51
+ gzip_proxied any;
52
+ gzip_comp_level 4;
53
+ gzip_types text/css application/javascript image/svg+xml;
54
+
47
55
# Redirect all non-SSL requests
48
56
if ($http_x_forwarded_proto != 'https') {
49
57
return 301 https://$host$request_uri;
@@ -64,6 +72,11 @@ http {
64
72
65
73
port_in_redirect off;
66
74
75
+ gzip on;
76
+ gzip_proxied any;
77
+ gzip_comp_level 4;
78
+ gzip_types text/css application/javascript image/svg+xml;
79
+
67
80
# Redirect all non-SSL requests
68
81
if ($http_x_forwarded_proto != 'https') {
69
82
return 301 https://$host$request_uri;
@@ -101,6 +114,12 @@ http {
101
114
102
115
root /app/.www;
103
116
117
+ location /assets {
118
+ proxy_cache STATIC;
119
+ proxy_ignore_headers Cache-Control;
120
+ proxy_cache_valid 60m;
121
+ }
122
+
104
123
location / {
105
124
index index.html index.htm;
106
125
}
Original file line number Diff line number Diff line change
1
+ # Initialize cache directory.
2
+ mkdir -p cache/nginx
3
+ echo ' script=heroku-start at=cache-initialized'
4
+ #
1
5
bin/start-nginx-solo
You can’t perform that action at this time.
0 commit comments