|
@@ -5,24 +5,17 @@ map $ssl_client_s_dn $ssl_client_s_dn_cn {
|
|
|
|
|
|
|
|
server {
|
|
server {
|
|
|
listen 443 ssl;
|
|
listen 443 ssl;
|
|
|
- server_name localhost;
|
|
|
|
|
|
|
+ # TODO: nginx doesn't natively support env variable expansion here, but
|
|
|
|
|
+ # you can eventually create a custom Dockerfile/entrypoint to populate
|
|
|
|
|
+ # this value from an env variable rather than hard-coding.
|
|
|
|
|
+ server_name vtn1.bsch.ca;
|
|
|
root /dev/null;
|
|
root /dev/null;
|
|
|
|
|
|
|
|
- # TODO: once the JACE sends an official Kyrio cert, this can be set to
|
|
|
|
|
- # 'on' so the trust-chain is verified against the CA certs in ssl.crt.
|
|
|
|
|
- # Also may require tuning of ssl_verify_depth directive.
|
|
|
|
|
-
|
|
|
|
|
- # In its current state EPRI will validate that the client cert's CN
|
|
|
|
|
- # is correct, but in theory someone could spoof it with a self-signed
|
|
|
|
|
- # certificate containing the "correct" CN.
|
|
|
|
|
-
|
|
|
|
|
- # Also note that webui admin routes will likely be hit without a client
|
|
|
|
|
- # cert, so you will probably want to either:
|
|
|
|
|
- # a) have a seperate server/vhost for VEN traffic vs. admin traffic
|
|
|
|
|
- # b) leave ssl_verify_client at optional or optional_no_ca, and match
|
|
|
|
|
- # on $ssl_client_verify in a location block.
|
|
|
|
|
-
|
|
|
|
|
- ssl_verify_client optional_no_ca;
|
|
|
|
|
|
|
+ # next 3 lines force clients to provide a client cert, and ensure that the
|
|
|
|
|
+ # cert is trusted by the chain in clientssl.crt.
|
|
|
|
|
+ ssl_verify_client on;
|
|
|
|
|
+ ssl_client_certificate /etc/ssl/clientssl.crt;
|
|
|
|
|
+ ssl_verify_depth 2;
|
|
|
|
|
|
|
|
# Don't advertise
|
|
# Don't advertise
|
|
|
server_tokens off;
|
|
server_tokens off;
|
|
@@ -51,3 +44,33 @@ server {
|
|
|
ssl_certificate /etc/ssl/ssl.crt;
|
|
ssl_certificate /etc/ssl/ssl.crt;
|
|
|
ssl_certificate_key /etc/ssl/ssl.key;
|
|
ssl_certificate_key /etc/ssl/ssl.key;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+server {
|
|
|
|
|
+ listen 443 ssl;
|
|
|
|
|
+ server_name admin.vtn1.bsch.ca;
|
|
|
|
|
+ root /dev/null;
|
|
|
|
|
+
|
|
|
|
|
+ # Don't advertise
|
|
|
|
|
+ server_tokens off;
|
|
|
|
|
+
|
|
|
|
|
+ # Don't merge slashes
|
|
|
|
|
+ merge_slashes off;
|
|
|
|
|
+
|
|
|
|
|
+ location / {
|
|
|
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
+ proxy_set_header Host $http_host;
|
|
|
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
+ proxy_set_header X-Forwarded-Ssl on;
|
|
|
|
|
+ proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
|
+ proxy_set_header X-Forwarded-Host $host;
|
|
|
|
|
+
|
|
|
|
|
+ proxy_set_header HTTPS true;
|
|
|
|
|
+
|
|
|
|
|
+ proxy_redirect off;
|
|
|
|
|
+ proxy_pass http://vtn-rails:8080;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ssl_certificate /etc/ssl/adminssl.crt;
|
|
|
|
|
+ ssl_certificate_key /etc/ssl/adminssl.key;
|
|
|
|
|
+}
|