-
Notifications
You must be signed in to change notification settings - Fork 22
/
nginx-proxy.conf
36 lines (28 loc) · 1.12 KB
/
nginx-proxy.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
# Required for govuk_publishing_components:
# Rack::Lint::LintError at /
# env missing required key SERVER_NAME
proxy_set_header Host $http_host;
# Required to pass the original request header to apps, useful for apps running
# behind router
map $http_x_forwarded_host $proxy_x_forwarded_host {
default $http_x_forwarded_host;
'' $http_host;
}
proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host;
map $http_govuk_request_id $govuk_request_id {
default $http_govuk_request_id;
'' $request_id;
}
proxy_set_header GOVUK-Request-Id $govuk_request_id;
# Required for external assets of frontend apps
add_header 'Access-Control-Allow-Origin' '*';
# Required for uploading files on various apps
client_max_body_size 500m;
proxy_read_timeout 200s;
# Rails 6.1 introduced a preload_links_header which can produce particularly
# large HTTP headers when running applications in development mode. These
# large headers can exhaust nginx proxy buffers causing a 502 response, to
# counter this these buffers are increased from their default 8k size.
proxy_buffer_size 128k;
proxy_buffers 8 128k;
proxy_busy_buffers_size 128k;