From 920c5e5844e715237d0cfad1562fa0a0f85d29c9 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 10 May 2026 13:10:39 -0500 Subject: fix: format latest nginx conf changes --- linux/nginx/etc/nginx/conf.d/cleberg.net.conf | 87 ++++++++++++--------------- 1 file changed, 39 insertions(+), 48 deletions(-) (limited to 'linux/nginx/etc') diff --git a/linux/nginx/etc/nginx/conf.d/cleberg.net.conf b/linux/nginx/etc/nginx/conf.d/cleberg.net.conf index f01416f..e01276f 100644 --- a/linux/nginx/etc/nginx/conf.d/cleberg.net.conf +++ b/linux/nginx/etc/nginx/conf.d/cleberg.net.conf @@ -7,64 +7,55 @@ server { include custom.d/security/content-security-policy.conf; include custom.d/security/permissions-policy.conf; root /var/www/cleberg.net/; + include custom.d/redirects/blog.conf; port_in_redirect off; add_header Onion-Location "http://paske4urhs6nttrtlkuwa5cowum3fjkc6yv6kl4ncx3mjxcd77764nqd.onion$request_uri" always; - location /org/ { - internal; - alias /var/www/cleberg.net/org/; - default_type text/markdown; - add_header Content-Type "text/markdown; charset=utf-8" always; - add_header Vary "Accept" always; - } - - location = / { - if ($http_accept ~* "text/markdown") { - rewrite ^/$ /org/index.org last; - } + location /org/ { + internal; + alias /var/www/cleberg.net/org/; + default_type text/markdown; + add_header Content-Type "text/markdown; charset=utf-8" always; + add_header Vary "Accept" always; + } - add_header Vary "Accept" always; - try_files /index.html =404; - } + location = / { + if ($http_accept ~* "text/markdown") { + rewrite ^/$ /org/index.org last; + } - location / { - try_files $uri $uri/ =404; - } + add_header Vary "Accept" always; + try_files /index.html =404; + } - location /blog/ { - rewrite ^/blog/((?!index)[^/]+)/(.*)$ /blog/$1.html permanent; - if ($http_accept ~* "text/markdown") { - rewrite ^/blog/([^/]+)\.html$ /org/blog/$1.org last; - } - } + location / { + try_files $uri $uri/ =404; + } - location ~ ^/(.+)\.html$ { - if ($http_accept ~* "text/markdown") { - rewrite ^/(.+)\.html$ /org/$1.org last; - } - add_header Vary "Accept" always; - try_files $uri =404; - } + location /blog/ { + rewrite ^/blog/((?!index)[^/]+)/(.*)$ /blog/$1.html permanent; + if ($http_accept ~* "text/markdown") { + rewrite ^/blog/([^/]+)\.html$ /org/blog/$1.org last; + } + } - location /atom.xml { return 301 $scheme://$host/feed.xml; } - location /blog/salary-transparency.html { return 301 $scheme://$host/salary/; } - include custom.d/redirects/blog.conf; + location ~ ^/(.+)\.html$ { + if ($http_accept ~* "text/markdown") { + rewrite ^/(.+)\.html$ /org/$1.org last; + } + add_header Vary "Accept" always; + try_files $uri =404; + } } server { - listen 10012; - server_name hutch.cleberg.net; - include custom.d/basic.conf; - include custom.d/security/strict-transport-security.conf; - include custom.d/security/content-security-policy.conf; - include custom.d/security/permissions-policy.conf; - - location = /privacy.html { - return 301 https://zerolabs.sh/hutch/privacy-policy/; - } - - location = / { - return 301 https://zerolabs.sh/hutch/; - } + listen 10012; + server_name hutch.cleberg.net; + include custom.d/basic.conf; + include custom.d/security/strict-transport-security.conf; + include custom.d/security/content-security-policy.conf; + include custom.d/security/permissions-policy.conf; + location = /privacy.html { return 301 https://zerolabs.sh/hutch/privacy-policy/; } + location = / { return 301 https://zerolabs.sh/hutch/; } } -- cgit v1.2.3