Repository navigation
Expand file tree
/
Copy pathnginx.conf
More file actions
76 lines (66 loc) · 2.17 KB
/
Copy pathnginx.conf
File metadata and controls
76 lines (66 loc) · 2.17 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
73
74
75
76
worker_processes auto;
pid /tmp/nginx.pid;
error_log /dev/stderr warn;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
server_tokens off;
# Re-resolve Docker service addresses after an API container is recreated.
resolver 127.0.0.11 valid=10s ipv6=off;
upstream save_api {
zone save_api 64k;
server api:8081 resolve;
keepalive 16;
}
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
server {
listen 8080;
listen [::]:8080;
server_name _;
root /usr/share/nginx/html;
index index.html;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy same-origin always;
# Modules are not fingerprinted: revalidate on update, avoiding stale clients.
add_header Cache-Control "no-cache" always;
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location /api/ {
client_max_body_size 1m;
proxy_pass http://save_api;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 5s;
proxy_read_timeout 30s;
proxy_cache off;
proxy_hide_header Cache-Control;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy same-origin always;
add_header Cache-Control "no-store" always;
}
location / {
try_files $uri $uri/ =404;
}
}
}