File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ deny all;
139139| ` VIRTUAL_PROTO ` | Protocol (` http ` , ` https ` , ` uwsgi ` , ` fastcgi ` ) | ` http ` |
140140| ` HTTPS_METHOD ` | ` redirect ` , ` noredirect ` , ` nohttps ` | ` redirect ` |
141141| ` SSL_POLICY ` | SSL/TLS policy | ` Mozilla-Modern ` |
142+ | ` SSL_STAPLING ` | Enable OCSP stapling (` on ` or ` off ` ) | ` on ` |
142143| ` HSTS ` | HSTS header value | ` max-age=31536000 ` |
143144| ` CERT_NAME ` | Custom certificate name | auto-detected |
144145| ` NETWORK_ACCESS ` | ` external ` or ` internal ` | ` external ` |
Original file line number Diff line number Diff line change @@ -358,6 +358,9 @@ server {
358358{{/* Get the HSTS defined by containers w/ the same vhost, falling back to "max-age=31536000" */ }}
359359{{ $hsts := or (first (groupByKeys $containers " Env.HSTS" )) " max-age=31536000" }}
360360
361+ {{/* Get the SSL_STAPLING defined by containers w/ the same vhost, falling back to "on" */ }}
362+ {{ $ssl_stapling := or (first (groupByKeys $containers " Env.SSL_STAPLING" )) " on" }}
363+
361364{{/* Get the VIRTUAL_ROOT By containers w/ use fastcgi root */ }}
362365{{ $vhost_root := or (first (groupByKeys $containers " Env.VIRTUAL_ROOT" )) " /var/www/public" }}
363366
@@ -445,7 +448,7 @@ server {
445448 ssl_dhparam {{ printf " /etc/nginx/certs/%s .dhparam.pem" $cert }};
446449 {{ end }}
447450
448- {{ if (exists (printf " /etc/nginx/certs/%s .chain.pem" $cert )) }}
451+ {{ if (and ( eq $ssl_stapling " on " ) ( exists (printf " /etc/nginx/certs/%s .chain.pem" $cert ) )) }}
449452 ssl_stapling on;
450453 ssl_stapling_verify on;
451454 ssl_trusted_certificate {{ printf " /etc/nginx/certs/%s .chain.pem" $cert }};
You can’t perform that action at this time.
0 commit comments