Commit 920c5e5844
Verified · cmc
Layout: unified · split
linux/nginx/etc/nginx/conf.d/cleberg.net.conf +39 −48
| @@ -7,64 +7,55 @@ server { | ||
| 7 | 7 | include custom.d/security/content-security-policy.conf; |
| 8 | 8 | include custom.d/security/permissions-policy.conf; |
| 9 | 9 | root /var/www/cleberg.net/; |
| 10 | include custom.d/redirects/blog.conf; | |
| 10 | 11 | port_in_redirect off; |
| 11 | 12 | |
| 12 | 13 | add_header Onion-Location "http://paske4urhs6nttrtlkuwa5cowum3fjkc6yv6kl4ncx3mjxcd77764nqd.onion$request_uri" always; |
| 13 | 14 | |
| 14 | location /org/ { | |
| 15 | internal; | |
| 16 | alias /var/www/cleberg.net/org/; | |
| 17 | default_type text/markdown; | |
| 18 | add_header Content-Type "text/markdown; charset=utf-8" always; | |
| 19 | add_header Vary "Accept" always; | |
| 20 | } | |
| 21 | ||
| 22 | location = / { | |
| 23 | if ($http_accept ~* "text/markdown") { | |
| 24 | rewrite ^/$ /org/index.org last; | |
| 25 | } | |
| 15 | location /org/ { | |
| 16 | internal; | |
| 17 | alias /var/www/cleberg.net/org/; | |
| 18 | default_type text/markdown; | |
| 19 | add_header Content-Type "text/markdown; charset=utf-8" always; | |
| 20 | add_header Vary "Accept" always; | |
| 21 | } | |
| 26 | 22 | |
| 27 | add_header Vary "Accept" always; | |
| 28 | try_files /index.html =404; | |
| 29 | } | |
| 23 | location = / { | |
| 24 | if ($http_accept ~* "text/markdown") { | |
| 25 | rewrite ^/$ /org/index.org last; | |
| 26 | } | |
| 30 | 27 | |
| 31 | location / { | |
| 32 | try_files $uri $uri/ =404; | |
| 33 | } | |
| 28 | add_header Vary "Accept" always; | |
| 29 | try_files /index.html =404; | |
| 30 | } | |
| 34 | 31 | |
| 35 | location /blog/ { | |
| 36 | rewrite ^/blog/((?!index)[^/]+)/(.*)$ /blog/$1.html permanent; | |
| 37 | if ($http_accept ~* "text/markdown") { | |
| 38 | rewrite ^/blog/([^/]+)\.html$ /org/blog/$1.org last; | |
| 39 | } | |
| 40 | } | |
| 32 | location / { | |
| 33 | try_files $uri $uri/ =404; | |
| 34 | } | |
| 41 | 35 | |
| 42 | location ~ ^/(.+)\.html$ { | |
| 43 | if ($http_accept ~* "text/markdown") { | |
| 44 | rewrite ^/(.+)\.html$ /org/$1.org last; | |
| 45 | } | |
| 46 | add_header Vary "Accept" always; | |
| 47 | try_files $uri =404; | |
| 48 | } | |
| 36 | location /blog/ { | |
| 37 | rewrite ^/blog/((?!index)[^/]+)/(.*)$ /blog/$1.html permanent; | |
| 38 | if ($http_accept ~* "text/markdown") { | |
| 39 | rewrite ^/blog/([^/]+)\.html$ /org/blog/$1.org last; | |
| 40 | } | |
| 41 | } | |
| 49 | 42 | |
| 50 | location /atom.xml { return 301 $scheme://$host/feed.xml; } | |
| 51 | location /blog/salary-transparency.html { return 301 $scheme://$host/salary/; } | |
| 52 | include custom.d/redirects/blog.conf; | |
| 43 | location ~ ^/(.+)\.html$ { | |
| 44 | if ($http_accept ~* "text/markdown") { | |
| 45 | rewrite ^/(.+)\.html$ /org/$1.org last; | |
| 46 | } | |
| 47 | add_header Vary "Accept" always; | |
| 48 | try_files $uri =404; | |
| 49 | } | |
| 53 | 50 | } |
| 54 | 51 | |
| 55 | 52 | server { |
| 56 | listen 10012; | |
| 57 | server_name hutch.cleberg.net; | |
| 58 | include custom.d/basic.conf; | |
| 59 | include custom.d/security/strict-transport-security.conf; | |
| 60 | include custom.d/security/content-security-policy.conf; | |
| 61 | include custom.d/security/permissions-policy.conf; | |
| 62 | ||
| 63 | location = /privacy.html { | |
| 64 | return 301 https://zerolabs.sh/hutch/privacy-policy/; | |
| 65 | } | |
| 66 | ||
| 67 | location = / { | |
| 68 | return 301 https://zerolabs.sh/hutch/; | |
| 69 | } | |
| 53 | listen 10012; | |
| 54 | server_name hutch.cleberg.net; | |
| 55 | include custom.d/basic.conf; | |
| 56 | include custom.d/security/strict-transport-security.conf; | |
| 57 | include custom.d/security/content-security-policy.conf; | |
| 58 | include custom.d/security/permissions-policy.conf; | |
| 59 | location = /privacy.html { return 301 https://zerolabs.sh/hutch/privacy-policy/; } | |
| 60 | location = / { return 301 https://zerolabs.sh/hutch/; } | |
| 70 | 61 | } |