-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
38 lines (32 loc) · 1.12 KB
/
nginx.conf
File metadata and controls
38 lines (32 loc) · 1.12 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
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Extract real client IP from X-Forwarded-For (behind Deploio ingress)
set_real_ip_from 10.0.0.0/8;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
# External syslog logging to blue.nine.ch
access_log syslog:server=blue.nine.ch:514,facility=local7,tag=nginx_access combined;
error_log syslog:server=blue.nine.ch:514,facility=local7,tag=nginx_error;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_types text/plain text/css text/javascript application/javascript application/json application/xml text/xml image/svg+xml;
# Static assets caching (images, fonts, css, js)
location ~* \.(jpg|jpeg|png|gif|ico|webp|svg|woff|woff2|ttf|css|js)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# HTML files - short cache for updates
location ~* \.html$ {
expires 1h;
add_header Cache-Control "public, must-revalidate";
}
# Default location
location / {
try_files $uri $uri/ =404;
}
}