Commit f0b90c30 authored by Valentin Samir's avatar Valentin Samir

[config.proxy] Config des redirections sur proxy

parent 916b11a1
......@@ -6,26 +6,32 @@
#### Conf nginx des proxy gérées à la main
non_sites_auto = [
non_sites_auto = {
u"discourse.crans.org",
u"impression.crans.org",
u"factures.crans.org",
u"accounts.crans.org",
u"intranet2.crans.org",
u"autostatus.crans.org",
u"wikipedia.crans.org",
u"hostnames-a-m.crans.org",
u"hostnames-n-z.crans.org",
u"crans.org",
u"i-p.crans.org",
u"adopteunpingouin.crans.org",
]
}
max_upload = {
u"intranet.crans.org" : "160M",
u"owncloud.crans.org" : "10G",
}
#: Redirection "host": "url"
sites_redirect = {
"impression.crans.org": "https://intranet.crans.org/impressions",
"factures.crans.org": "https://intranet.crans.org/factures",
"accounts.crans.org": "https://intranet.crans.org/compte",
"intranet2.crans.org": "https://intranet.crans.org",
"autostatus.crans.org": "https://www.crans.org/CransNounous/AutoStatus",
"wikipedia.crans.org": "https://wiki.crans.org",
"crans.org": "https://www.crans.org",
"install-party.ens-cachan.fr": "https://install-party.crans.org",
"www.install-party.ens-cachan.fr": "https://install-party.crans.org",
"adopteunpingouin.crans.org": "https://install-party.crans.org",
"i-p.crans.org": "https://install-party.crans.org",
"hostnames-a-m.crans.org": "https://proxy.crans.org",
"hostnames-n-z.crans.org": "https://proxy.crans.org",
}
def server_name_to_cert_name(serveur):
"""
......@@ -49,6 +55,8 @@ def server_name_to_cert_name(serveur):
site_template = """server {
server_name %(serveur)s;
include "snippets/proxy-common.conf";
return 302 https://$host$request_uri;
}
server {
......@@ -72,6 +80,8 @@ server {
site_redirect_template = """server {
server_name %(serveur)s;
include "snippets/proxy-common.conf";
return 302 %(redirect)s$request_uri;
}
server {
......@@ -82,9 +92,6 @@ server {
ssl_certificate_key /etc/letsencrypt/live/%(cert_name)s/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/%(cert_name)s/chain.pem;
location / {
rewrite ^(.*)$ https://%(redirect)s$1;
}
return 302 %(redirect)s$request_uri;
}
"""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment