forked from mozilla-releng/balrog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
62 lines (52 loc) · 2.63 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
# This file is intended to mirror the CloudOps nginx config as closely as possible.
# It can found at https://github.com/mozilla-services/cloudops-deployment/blob/master/projects/balrog/puppet/modules/balrog/templates/admin.openresty.conf.erb
log_format balrog_admin_format
'admin $msec "$remote_addr" "$request" $status $request_length $body_bytes_sent '
'$remote_user $request_time $upstream_response_time "$http_user_agent" "$gzip_ratio"';
log_format balrog_agent_format
'agent $msec "$remote_addr" "$request" $status $request_length $body_bytes_sent '
'$remote_user $request_time $upstream_response_time "$http_user_agent" "$gzip_ratio"';
server {
listen $NGINX_PORT default;
ssl on;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.key;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 30m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';
ssl_prefer_server_ciphers on;
access_log /dev/stdout balrog_admin_format;
error_log /dev/stdout;
client_max_body_size 5M;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass $BALROG_ADMIN_ROOT;
proxy_http_version 1.1;
}
# do not require auth on info endpoints
location ~ ^/__(version|heartbeat|lbheartbeat)__$ {
proxy_redirect off;
proxy_pass $BALROG_ADMIN_ROOT;
proxy_http_version 1.1;
}
}
# custom entrypoint for balrog agent
# required to add the REMOTE_USER variable which balrog uses
# to authenticate
server {
# Don't log requests from localhost, to avoid spamming the local dev log with health check requests
access_log /dev/stdout balrog_agent_format;
error_log /dev/stdout;
# This is bound to 127.0.0.1 in production, which doesn't work for local dev for reasons
# I haven't determined yet...
listen $NGINX_BALROG_AGENT_PORT;
location / {
proxy_redirect off;
proxy_pass $BALROG_ADMIN_ROOT;
proxy_http_version 1.1;
}
}