-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathnginx.conf
More file actions
72 lines (60 loc) · 2.45 KB
/
nginx.conf
File metadata and controls
72 lines (60 loc) · 2.45 KB
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
65
66
67
68
69
70
71
72
pid /tmp/nginx.pid; #for running as non-root
events {
worker_connections 4096; ## Default: 1024
}
http {
#for running as non-root
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
# Gzip Settings
gzip on;
gzip_vary on; # prevents cache issues
gzip_static on; # allows pre-serving of .gz file if it exists
gzip_min_length 256; # Only gzip files of size in bytes
gzip_proxied any; # enable gzip for all proxied requests
gzip_comp_level 6;
gzip_types text/plain text/css application/javascript application/json application/xml text/xml image/svg+xml application/manifest+json;
gunzip on; # Decompress gzipped upstream responses for clients that don't support gzip (proxy-only)
listen 8086;
server_name localhost;
location /healthz {
return 200 'OK';
}
location /readiness {
add_header Content-Type application/json;
add_header Cache-Control "no-cache, no-store, must-revalidate";
return 200 '{"status": "ok", "release": "${REACT_APP_RELEASE}", "packageVersion": "${APP_VERSION}"}';
}
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
include /etc/nginx/env/nginx_env.conf;
# Never cache runtime configuration files
location = /env-config.js {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
location = /test-env-config.js {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Static assets with versioning/hashing - cache aggressively
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# Don't cache HTML files
location ~* \.html$ {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}