mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-20 02:52:11 +00:00
Check if the user decided to not install Nextcloud and configure Nginx accordingly
This commit is contained in:
parent
8eb89c2b4e
commit
bc7aa885e4
17
conf/nginx-primaryonly-no-nextcloud.conf
Normal file
17
conf/nginx-primaryonly-no-nextcloud.conf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Control Panel
|
||||||
|
# Proxy /admin to our Python based control panel daemon. It is
|
||||||
|
# listening on IPv4 only so use an IP address and not 'localhost'.
|
||||||
|
location /admin/assets {
|
||||||
|
alias /usr/local/lib/mailinabox/vendor/assets;
|
||||||
|
}
|
||||||
|
rewrite ^/admin$ /admin/;
|
||||||
|
rewrite ^/admin/munin$ /admin/munin/ redirect;
|
||||||
|
location /admin/ {
|
||||||
|
proxy_pass http://127.0.0.1:10222/;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
add_header X-Frame-Options "DENY";
|
||||||
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
add_header Content-Security-Policy "frame-ancestors 'none';";
|
||||||
|
}
|
||||||
|
|
||||||
|
# ADDITIONAL DIRECTIVES HERE
|
@ -8,6 +8,7 @@ from mailconfig import get_mail_domains
|
|||||||
from dns_update import get_custom_dns_config, get_dns_zones
|
from dns_update import get_custom_dns_config, get_dns_zones
|
||||||
from ssl_certificates import get_ssl_certificates, get_domain_ssl_files, check_certificate
|
from ssl_certificates import get_ssl_certificates, get_domain_ssl_files, check_certificate
|
||||||
from utils import shell, safe_domain_name, sort_domains
|
from utils import shell, safe_domain_name, sort_domains
|
||||||
|
from os import environ
|
||||||
|
|
||||||
def get_web_domains(env, include_www_redirects=True, exclude_dns_elsewhere=True):
|
def get_web_domains(env, include_www_redirects=True, exclude_dns_elsewhere=True):
|
||||||
# What domains should we serve HTTP(S) for?
|
# What domains should we serve HTTP(S) for?
|
||||||
@ -77,6 +78,10 @@ def do_web_update(env):
|
|||||||
# Load the templates.
|
# Load the templates.
|
||||||
template0 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx.conf")).read()
|
template0 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx.conf")).read()
|
||||||
template1 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-alldomains.conf")).read()
|
template1 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-alldomains.conf")).read()
|
||||||
|
# Check if the user doesn't want Nextcloud.
|
||||||
|
if environ.get('DISABLE_NEXTCLOUD') == '1':
|
||||||
|
template2 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-primaryonly-no-nextcloud.conf")).read()
|
||||||
|
else:
|
||||||
template2 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-primaryonly.conf")).read()
|
template2 = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-primaryonly.conf")).read()
|
||||||
template3 = "\trewrite ^(.*) https://$REDIRECT_DOMAIN$1 permanent;\n"
|
template3 = "\trewrite ^(.*) https://$REDIRECT_DOMAIN$1 permanent;\n"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user