From 45be38aea6ce39adaa6f5c65d46c851428c478e0 Mon Sep 17 00:00:00 2001 From: Adar Nimrod Date: Sat, 16 Jan 2021 23:30:27 +0200 Subject: [PATCH] Serve {www,}.shore.co.il on ns4. Should be faster. Just static files anyway. --- conf.d/shore.co.il.conf | 31 +++++++++++++++++++++ conf.d/www.shore.co.il.conf | 43 ++++++++++++++++++++++++++++++ snippets/nextcloud-well-known.conf | 11 ++++++++ snippets/z-push.conf | 19 +++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 conf.d/shore.co.il.conf create mode 100644 conf.d/www.shore.co.il.conf create mode 100644 snippets/nextcloud-well-known.conf create mode 100644 snippets/z-push.conf diff --git a/conf.d/shore.co.il.conf b/conf.d/shore.co.il.conf new file mode 100644 index 0000000..437a1da --- /dev/null +++ b/conf.d/shore.co.il.conf @@ -0,0 +1,31 @@ +map $host $z_push { default z-push; } + +server { + listen 80; + listen [::]:80; + server_name shore.co.il; + include snippets/robots-allow-all.conf; + include snippets/ads-txt.conf; + include snippets/security-txt.conf; + location = / { return 301 https://$host/blog/; } + location /repo/ { + root /var/www/www.shore.co.il/; + autoindex on; + } + include snippets/redirect-https.conf; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + server_name shore.co.il; + include snippets/robots-allow-all.conf; + include snippets/ads-txt.conf; + include snippets/security-txt.conf; + include snippets/ssl.conf; + include snippets/nextcloud-well-known.conf; + include snippets/z-push.conf; + + location = / { return 301 https://www.shore.co.il/blog/; } + include snippets/redirect-www.conf; +} diff --git a/conf.d/www.shore.co.il.conf b/conf.d/www.shore.co.il.conf new file mode 100644 index 0000000..9e6d0a1 --- /dev/null +++ b/conf.d/www.shore.co.il.conf @@ -0,0 +1,43 @@ +server { + listen 80; + listen [::]:80; + server_name www.shore.co.il; + include snippets/robots-allow-all.conf; + include snippets/ads-txt.conf; + include snippets/security-txt.conf; + location = / { return 301 https://$host/blog/; } + location /repo/ { + root /var/www/www.shore.co.il/; + autoindex on; + } + include redirect-https.conf; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + server_name www.shore.co.il; + include snippets/robots-allow-all.conf; + include snippets/ads-txt.conf; + include snippets/security-txt.conf; + include snippets/ssl.conf; + root /var/www/www.shore.co.il/; + error_page 404 /; + + location /repo/ { autoindex on; } + location = /resume { try_files $uri /resume/resume.html; } + location = /resume/ { index resume.html; } + + location = / { return 301 https://$host/blog/; } + location /about { return 301 https://$host/blog/pages/about-me.html; } + location /spam { return 301 https://$host/blog/pages/spam.html; } + location = /blog { + try_files $uri /blog/index.html; + charset UTF-8; + } + + location /cgit { return 301 https://git.shore.co.il/explore; } + location /cgit/ { return 301 https://git.shore.co.il/explore; } + location /git { return 301 https://git.shore.co.il/explore; } + location /git/ { return 301 https://git.shore.co.il/explore; } +} diff --git a/snippets/nextcloud-well-known.conf b/snippets/nextcloud-well-known.conf new file mode 100644 index 0000000..f615565 --- /dev/null +++ b/snippets/nextcloud-well-known.conf @@ -0,0 +1,11 @@ +location /.well-known/caldav { + return 301 https://nextcloud.shore.co.il/remote.php/dav; +} + +location /.well-known/carddav { + return 301 https://nextcloud.shore.co.il/remote.php/dav; +} + +location /.well-known/webfinger { + return 301 https://nextcloud.shore.co.il/public.php?service=webfinger; +} diff --git a/snippets/z-push.conf b/snippets/z-push.conf new file mode 100644 index 0000000..ccc2147 --- /dev/null +++ b/snippets/z-push.conf @@ -0,0 +1,19 @@ +location /AutoDiscover/ { + proxy_pass https://$z_push$request_uri; + include snippets/proxy-headers.conf; +} + +location /Autodiscover/ { + proxy_pass https://$z_push$request_uri; + include snippets/proxy-headers.conf; +} + +location /autodiscover/ { + proxy_pass https://$z_push$request_uri; + include snippets/proxy-headers.conf; +} + +location /Microsoft-Server-ActiveSync { + proxy_pass https://$z_push$request_uri; + include snippets/proxy-headers.conf; +} -- GitLab