forked from ployst/docker-nginx-ssl-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy.conf
63 lines (52 loc) · 1.63 KB
/
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
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
upstream target_service {
server {{TARGET_SERVICE}};
}
upstream cert_service {
server {{CERT_SERVICE}};
}
server {
server_name _;
listen 80;
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://cert_service;
proxy_read_timeout 90;
}
}
server {
server_name _;
listen 443;
ssl on;
ssl_certificate /etc/secrets/proxycert;
ssl_certificate_key /etc/secrets/proxykey;
ssl_dhparam /etc/secrets/dhparam;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH:!CAMELLIA;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security max-age=15638400;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_pass http://target_service;
proxy_read_timeout 90;
proxy_redirect http:// https://;
proxy_http_version 1.1;
}
}