-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
43 lines (35 loc) · 993 Bytes
/
Copy pathnginx.conf
File metadata and controls
43 lines (35 loc) · 993 Bytes
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
server {
listen 80;
# Remove nginx version from "Server" response header
server_tokens off;
# gzip
# Minimal required
gzip on;
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
# Optional but Recommended Properties:
gzip_comp_level 5;
gzip_min_length 1024;
gzip_proxied any;
root /usr/share/nginx/html;
index index.html;
# Health check endpoint
location /healthz {
add_header Content-Type application/json;
return 200 "{\"status\": \"OK\"}";
}
# API proxy
location /api/ {
proxy_pass https://jsonplaceholder.typicode.com/;
proxy_ssl_server_name on;
}
# Explicitly prevent caching of index.html (https://stackoverflow.com/questions/40243633/disable-nginx-cache-for-javascript-files)
location = /index.html {
expires -1;
etag off;
add_header Cache-Control 'no-store, no-cache';
}
location / {
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
}