-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi
More file actions
46 lines (41 loc) · 1.65 KB
/
api
File metadata and controls
46 lines (41 loc) · 1.65 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
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
text/javascript max;
application/javascript max;
~image/ max;
}
server {
listen 80;
listen [::]:80;
server_name API_HOSTNAME;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl;
server_name API_HOSTNAME;
expires $expires;
ssl_certificate /etc/nginx/ssl/API_HOSTNAME/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/API_HOSTNAME/privkey.pem;
include snippets/ssl-params.conf;
location / {
limit_req zone=api burst=100 nodelay;
proxy_pass http://api:8011;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache STATIC;
proxy_cache_lock on;
# To forcefully cache content via Nginx
proxy_ignore_headers Cache-Control;
proxy_cache_valid 200 301 1d;
proxy_cache_valid 302 1h;
proxy_cache_valid any 5m;
proxy_cache_revalidate on;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
}
}