From dcb558b45129caeb94c23dc12379065e33fa7543 Mon Sep 17 00:00:00 2001 From: apostolof Date: Thu, 25 Feb 2021 21:24:31 +0200 Subject: [PATCH] refactor: add conf that redirects traffic to non www urls --- docker-compose.yml | 3 +- .../client-max-body-size.conf | 0 nginx-reverse-proxy-confs/redirect.conf | 64 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) rename client-max-body-size.conf => nginx-reverse-proxy-confs/client-max-body-size.conf (100%) create mode 100644 nginx-reverse-proxy-confs/redirect.conf diff --git a/docker-compose.yml b/docker-compose.yml index b7ab4a2..f91e242 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,8 @@ services: - ./volumes/nginx/html:/usr/share/nginx/html - ./volumes/nginx/dhparam:/etc/nginx/dhparam - ./volumes/nginx/certs:/etc/nginx/certs:ro - - ./client-max-body-size.conf:/etc/nginx/conf.d/client-max-body-size.conf:ro + - ./nginx-reverse-proxy-confs/client-max-body-size.conf:/etc/nginx/conf.d/client-max-body-size.conf:ro + - ./nginx-reverse-proxy-confs/redirect.conf:/etc/nginx/conf.d/redirect.conf:ro # Letsencrypt automated creation, renewal and use of Let's Encrypt certificates # Reference: diff --git a/client-max-body-size.conf b/nginx-reverse-proxy-confs/client-max-body-size.conf similarity index 100% rename from client-max-body-size.conf rename to nginx-reverse-proxy-confs/client-max-body-size.conf diff --git a/nginx-reverse-proxy-confs/redirect.conf b/nginx-reverse-proxy-confs/redirect.conf new file mode 100644 index 0000000..5ea65c1 --- /dev/null +++ b/nginx-reverse-proxy-confs/redirect.conf @@ -0,0 +1,64 @@ +server { + server_name www.ecentrics.net; + return 301 $scheme://ecentrics.net$request_uri; +} + +server { + server_name www.jenkins.ecentrics.net; + return 301 $scheme://jenkins.ecentrics.net$request_uri; +} + +server { + server_name www.concordia.ecentrics.net; + return 301 $scheme://concordia.ecentrics.net$request_uri; +} + +server { + server_name www.staging.concordia.ecentrics.net; + return 301 $scheme://staging.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.guide.concordia.ecentrics.net; + return 301 $scheme://guide.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.staging.guide.concordia.ecentrics.net; + return 301 $scheme://staging.guide.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.ganache.ecentrics.net; + return 301 $scheme://ganache.ecentrics.net$request_uri; +} + +server { + server_name www.staging.ganache.ecentrics.net; + return 301 $scheme://staging.ganache.ecentrics.net$request_uri; +} + +server { + server_name www.rendezvous.ecentrics.net; + return 301 $scheme://rendezvous.ecentrics.net$request_uri; +} + +server { + server_name www.contracts.concordia.ecentrics.net; + return 301 $scheme://contracts.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.staging.contracts.concordia.ecentrics.net; + return 301 $scheme://staging.contracts.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.pinner.concordia.ecentrics.net; + return 301 $scheme://pinner.concordia.ecentrics.net$request_uri; +} + +server { + server_name www.staging.pinner.concordia.ecentrics.net; + return 301 $scheme://staging.pinner.concordia.ecentrics.net$request_uri; +} \ No newline at end of file