-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb2010_nginx.conf
97 lines (83 loc) · 2.6 KB
/
web2010_nginx.conf
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
server {
listen 8080;
charset utf-8;
# Configure Real IP module
# Set trusted Cloudflare IP ranges (https://www.cloudflare.com/ips/)
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 172.69.225.0/24;
set_real_ip_from 162.158.148.0/24;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;
# Set trusted EPFL IP ranges
set_real_ip_from 10.20.0.0/16; # prod/staging
set_real_ip_from 128.178.211.0/24; # prod/staging
real_ip_header CF-Connecting-IP;
real_ip_recursive on;
# Hide nginx version information.
server_tokens off;
error_page 404 /errors/404.fr.shtml;
error_page 503 /errors/503.fr.shtml;
location / {
root /usr/share/nginx/html;
ssi on;
}
location ~* \.(js|css|gif|png|jpg)$ {
root /usr/share/nginx/html;
add_header Cache-Control "max-age=86400, public";
}
location ^~ /templates/ {
root /usr/share/nginx/html;
add_header Cache-Control "max-age=86400, public";
ssi on;
}
# Enable Gzip compression.
gzip on;
# Enable compression both for HTTP/1.0 and HTTP/1.1.
gzip_http_version 1.0;
# Compression level (1-9).
gzip_comp_level 6;
# Don't compress anything that's already small and unlikely to shrink
# much if at all (the default is 20 bytes, which is bad as that usually
# leads to larger files after gzipping).
gzip_min_length 1100;
# Compress data even for clients that are connecting to us via proxies,
# identified by the "Via" header.
gzip_proxied any;
# Compress all output labeled with one of the following MIME-types.
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;
# text/html is always compressed by HttpGzipModule
}