Keep root in actual local.conf file

This commit is contained in:
David Duque 2020-09-27 02:17:49 +01:00
parent 81c64f0a8f
commit 2bfa65329a
No known key found for this signature in database
GPG Key ID: 2F327738A3C0AE3A
2 changed files with 6 additions and 5 deletions

View File

@ -1,3 +1,5 @@
root $ROOT;
# ADDITIONAL DIRECTIVES HERE
location = /robots.txt {

View File

@ -198,11 +198,9 @@ def make_domain_config(domain, templates, ssl_certificates, env):
if not os.path.exists(nginx_conf_custom_include):
with open(nginx_conf_custom_include, "a+") as f:
f.writelines([
f"# Custom configurations for {domain} go here",
"# To use php: use the \"php-fpm\" alias",
""
f"root {root};",
"index index.html index.htm;"
f"# Custom configurations for {domain} go here\n",
"# To use php: use the \"php-fpm\" alias\n\n",
"index index.html index.htm;\n"
])
nginx_conf_extra += "\tinclude %s;\n" % (nginx_conf_custom_include)
@ -218,6 +216,7 @@ def make_domain_config(domain, templates, ssl_certificates, env):
# Replace substitution strings in the template & return.
nginx_conf = nginx_conf.replace("$STORAGE_ROOT", env['STORAGE_ROOT'])
nginx_conf = nginx_conf.replace("$HOSTNAME", domain)
nginx_conf = nginx_conf.replace("$ROOT", root)
nginx_conf = nginx_conf.replace("$SSL_KEY", tls_cert["private-key"])
nginx_conf = nginx_conf.replace("$SSL_CERTIFICATE", tls_cert["certificate"])
nginx_conf = nginx_conf.replace("$REDIRECT_DOMAIN", re.sub(r"^www\.", "", domain)) # for default www redirects to parent domain