Don't configure HTTPS site when certs missing
This commit is contained in:
parent
8a870f6fd6
commit
6da190b110
@ -11,17 +11,16 @@ map $http_upgrade $connection_upgrade {
|
|||||||
'' close;
|
'' close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) %>
|
||||||
server {
|
server {
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl http2;
|
listen [::]:443 ssl http2;
|
||||||
server_name <%= @server_name %>;
|
server_name <%= @server_name %>;
|
||||||
include <%= @shared_config_path %>;
|
include <%= @shared_config_path %>;
|
||||||
|
|
||||||
<% if File.exist?(@ssl_cert) &&
|
|
||||||
File.exist?(@ssl_key) -%>
|
|
||||||
ssl_certificate <%= @ssl_cert %>;
|
ssl_certificate <%= @ssl_cert %>;
|
||||||
ssl_certificate_key <%= @ssl_key %>;
|
ssl_certificate_key <%= @ssl_key %>;
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
add_header Strict-Transport-Security "max-age=31536000";
|
add_header Strict-Transport-Security "max-age=31536000";
|
||||||
}
|
}
|
||||||
|
<% end %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user