-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
72 lines (62 loc) · 2.09 KB
/
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
worker_processes 1;
daemon off;
events { worker_connections 1024; }
http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;
gzip on;
gzip_vary on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gunzip on;
gzip_static always;
gzip_types text/plain text/css text/js text/xml
text/javascript application/javascript application/x-javascript
application/json application/xml application/xml+rss
font/ttf font/otf font/x-woff image/svg+xml
application/vnd.ms-fontobject
application/ttf application/x-ttf application/otf
application/x-otf application/truetype application/eot
application/opentype application/x-opentype application/woff
application/font application/font-woff woff application/font-sfnt;
tcp_nopush on;
keepalive_timeout 30;
port_in_redirect off; # Ensure that redirects don't include the internal container PORT - {{port}}
server_tokens off;
proxy_buffering off;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
real_ip_header X-Forwarded-For;
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 127.0.0.1/32;
real_ip_recursive on;
server {
listen {{port}};
add_header Strict-Transport-Security "max-age=31536000";
add_header X-Frame-Options "SAMEORIGIN";
allow 0.0.0.0/0; # world
deny all;
location / {
proxy_pass {{env "SCHEMA"}}{{env "BACKEND"}};
proxy_set_header Accept-Encoding "";
sub_filter 'xkcd.com' '{{env "PROXY"}}';
sub_filter 'imgs.xkcd.com' '{{env "PROXY"}}/imgs';
sub_filter_once off;
sub_filter_types text/html text/plain text/css text/js text/xml
text/javascript application/javascript application/x-javascript
application/json application/xml;
}
location /imgs {
rewrite /imgs/(.+) /$1 break;
proxy_pass https://imgs.xkcd.com;
}
}
}