diff --git a/conf.d/shore.co.il.conf b/conf.d/shore.co.il.conf new file mode 100644 index 0000000000000000000000000000000000000000..437a1da370e93778eefaf7805974bea691f3f727 --- /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 0000000000000000000000000000000000000000..b62661bb00c651976261d091004ca62a839bfc02 --- /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 snippets/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/docker-compose.yml b/docker-compose.yml index bf2e1833ee4fd4fa5df1c70825f08659c3c5306f..d01206fc22fc67327015c8dadb121efad6d5df47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,17 +5,20 @@ services: build: context: ./ # command: ["nginx", "-g", "daemon off;"] - hostname: &hostname shore.co.il + hostname: &hostname www.shore.co.il networks: default: aliases: - *hostname - autoconfig.shore.co.il + - registry.shore.co.il ports: - '80:80' - '443:443' restart: always volumes: + - '/var/www/www.shore.co.il/blog:/var/www/www.shore.co.il/blog:ro' + - '/var/www/www.shore.co.il/resume:/var/www/www.shore.co.il/resume:ro' - '/var/www/www.shore.co.il/.well-known/acme-challenge:/var/www/www.shore.co.il/.well-known/acme-challenge:ro' - '/var/ssl/site.key:/var/ssl/site.key:ro' - '/var/ssl/site.crt:/var/ssl/site.crt:ro' diff --git a/snippets/nextcloud-well-known.conf b/snippets/nextcloud-well-known.conf new file mode 100644 index 0000000000000000000000000000000000000000..f615565196d8cdaf782f460030ec1514fa4c232a --- /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 0000000000000000000000000000000000000000..ccc2147d50fb996664d7127bfc937c10e98aab5e --- /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; +} diff --git a/www/www.shore.co.il/google88c23a5c89fa3cb3.html b/www/www.shore.co.il/google88c23a5c89fa3cb3.html new file mode 100644 index 0000000000000000000000000000000000000000..ceace0b5e9d1937c18b05816d6ec871e20bb5afa --- /dev/null +++ b/www/www.shore.co.il/google88c23a5c89fa3cb3.html @@ -0,0 +1 @@ +google-site-verification: google88c23a5c89fa3cb3.html \ No newline at end of file