I've been looking closer at the Forge+LetsEncrypt configuration. When you enable SSL on forge it uses some includes to configure the HTTP to HTTPS redirection:
Extract from the main nginx site config.
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/dev.example.com/before/*;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name dev.example.com;
root /home/forge/dev.example.com/public;
# ...
}
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/dev.example.com/after/*;
Within forge-conf/dev.example.com/before/ssl_redirect.conf the 80 => 443 redirection is done:
# Redirect every request to HTTPS...
server {
listen 80;
listen [::]:80;
server_name .dev.example.com;
return 301 https://$host$request_uri;
}
# Redirect SSL to primary domain SSL...
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# FORGE SSL (DO NOT REMOVE!)
# ...
server_name www.dev.example.com;
return 301 https://dev.example.com$request_uri;
}
Question is, can I modify the files under forge-config? Or do I run the risk of them being updated by forge at some point?