From 971a018ea197915a3c3279330dda84c842c7ec3d Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 22 Feb 2026 11:51:28 -0600 Subject: add markdown fetch support for agents --- linux/nginx/etc/nginx/conf.d/cleberg.net.conf | 30 ++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/linux/nginx/etc/nginx/conf.d/cleberg.net.conf b/linux/nginx/etc/nginx/conf.d/cleberg.net.conf index e9f2ad3..0570488 100644 --- a/linux/nginx/etc/nginx/conf.d/cleberg.net.conf +++ b/linux/nginx/etc/nginx/conf.d/cleberg.net.conf @@ -19,9 +19,32 @@ server { include custom.d/tls/policy_balanced.conf; include custom.d/basic.conf; root /var/www/cleberg.net/; - location / { try_files $uri $uri/ =404; } - location /blog/ { rewrite ^/blog/((?!index)[^/]+)/(.*)$ /blog/$1.html permanent; } - location /wiki/ { rewrite ^/wiki/((?!index)[^/]+)/(.*)$ /wiki/$1.html permanent; } + + location /org/ { + internal; + alias /var/www/cleberg.net/org/; + default_type text/plain; + add_header Content-Type "text/plain; charset=utf-8"; + } + + location / { + try_files $uri $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 ~ ^/([^/]+)\.html$ { + if ($http_accept ~* "text/markdown") { + rewrite ^/([^/]+)\.html$ /org/$1.org last; + } + try_files $uri =404; + } + location /atom.xml { return 301 $scheme://$host/feed.xml; } location /blog/salary-transparency.html { return 301 $scheme://$host/salary/; } } @@ -32,3 +55,4 @@ server { server_name www.cleberg.net cleberg.net; return 301 https://cleberg.net$request_uri; } + -- cgit v1.2.3