-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx.conf
99 lines (84 loc) · 2.59 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
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
98
99
worker_processes 1;
daemon off;
error_log stderr;
events { worker_connections 1024; }
http {
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_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;
tcp_nopush on;
keepalive_timeout 300;
proxy_connect_timeout 300;
proxy_read_timeout 300;
# Ensure that redirects don't include the internal container PORT - {{port}}
port_in_redirect off;
server_tokens off;
server {
listen {{port}};
server_name localhost;
# Restrict IPs
include blockips.conf;
client_max_body_size 100M;
include redirects-www.conf;
include redirects-e-regs.conf;
# Redirect for bulk-downloads bucket (needed this redirect here in order to access environment variable)
rewrite ^/files/bulk-downloads/(.*)$ {{env "S3_LEGAL_AND_DOWNLOADS_URL"}}/bulk-downloads/$1 redirect;
location / {
resolver {{nameservers}} ipv6=off valid=1s;
set $backend "{{env "CMS_PROXY"}}";
proxy_pass $backend;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name "/";
}
location ~ /resources/(.*) {
resolver 8.8.8.8;
proxy_pass_request_headers off;
proxy_pass {{env "S3_BUCKET_URL"}}/$1;
}
location ~ /files/(.*) {
resolver 8.8.8.8;
keepalive_timeout 180;
proxy_pass_request_headers off;
proxy_pass {{env "S3_LEGAL_AND_DOWNLOADS_URL"}}/$1;
}
}
server {
listen {{port}};
server_name beta.fec.gov;
rewrite ^/(.*)$ https://www.fec.gov/$1 permanent;
}
server {
listen {{port}};
server_name transition.fec.gov;
include redirects-transition.conf;
location / {
resolver 8.8.8.8;
error_page 404 error.html;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-s3cmd-attrs;
proxy_pass {{env "S3_TRANSITION_URL"}}$uri;
add_header X-Frame-Options "SAMEORIGIN";
}
}
server {
listen {{port}};
server_name test-eqs.fec.gov;
include redirects-eqs.conf;
}
server {
listen {{port}};
server_name eqs.fec.gov;
include redirects-eqs.conf;
}
}