mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-24 07:37:04 +00:00
Keep root in actual local.conf file
This commit is contained in:
parent
81c64f0a8f
commit
2bfa65329a
@ -1,3 +1,5 @@
|
|||||||
|
root $ROOT;
|
||||||
|
|
||||||
# ADDITIONAL DIRECTIVES HERE
|
# ADDITIONAL DIRECTIVES HERE
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
|
@ -198,11 +198,9 @@ def make_domain_config(domain, templates, ssl_certificates, env):
|
|||||||
if not os.path.exists(nginx_conf_custom_include):
|
if not os.path.exists(nginx_conf_custom_include):
|
||||||
with open(nginx_conf_custom_include, "a+") as f:
|
with open(nginx_conf_custom_include, "a+") as f:
|
||||||
f.writelines([
|
f.writelines([
|
||||||
f"# Custom configurations for {domain} go here",
|
f"# Custom configurations for {domain} go here\n",
|
||||||
"# To use php: use the \"php-fpm\" alias",
|
"# To use php: use the \"php-fpm\" alias\n\n",
|
||||||
""
|
"index index.html index.htm;\n"
|
||||||
f"root {root};",
|
|
||||||
"index index.html index.htm;"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
nginx_conf_extra += "\tinclude %s;\n" % (nginx_conf_custom_include)
|
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.
|
# Replace substitution strings in the template & return.
|
||||||
nginx_conf = nginx_conf.replace("$STORAGE_ROOT", env['STORAGE_ROOT'])
|
nginx_conf = nginx_conf.replace("$STORAGE_ROOT", env['STORAGE_ROOT'])
|
||||||
nginx_conf = nginx_conf.replace("$HOSTNAME", domain)
|
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_KEY", tls_cert["private-key"])
|
||||||
nginx_conf = nginx_conf.replace("$SSL_CERTIFICATE", tls_cert["certificate"])
|
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
|
nginx_conf = nginx_conf.replace("$REDIRECT_DOMAIN", re.sub(r"^www\.", "", domain)) # for default www redirects to parent domain
|
||||||
|
Loading…
Reference in New Issue
Block a user