-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
54 lines (46 loc) · 1.6 KB
/
nginx.conf
File metadata and controls
54 lines (46 loc) · 1.6 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
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json image/svg+xml;
# Custom 404 error page
error_page 404 /404.html;
location = /404.html {
internal;
}
# Don't allow the site to be embedded in an iframe
add_header X-Frame-Options "SAMEORIGIN" always;
# Cache HTML at edge (purge via Cloudflare API on deploy)
etag on;
add_header Cache-Control "public, max-age=0, s-maxage=31536000, must-revalidate";
# Static assets: cache for 1 year
location /static/ {
add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Frame-Options "SAMEORIGIN" always;
}
location /script.js {
proxy_pass https://umami.loopwerk.io/script.js;
proxy_set_header Host umami.loopwerk.io;
proxy_ssl_server_name on;
proxy_buffering on;
}
location /api/send {
proxy_pass https://umami.loopwerk.io/api/send;
proxy_set_header Host umami.loopwerk.io;
proxy_ssl_server_name on;
proxy_buffering on;
proxy_set_header X-Client-Real-IP $http_cf_connecting_ip;
proxy_set_header X-Forwarded-For $http_cf_connecting_ip;
proxy_set_header X-Real-IP $http_cf_connecting_ip;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
}
location / {
try_files $uri $uri/ =404;
}
}