From 2b39d686d9f5c33ecf881b214fb43f7f19d91db2 Mon Sep 17 00:00:00 2001 From: CaptainJack2491 Date: Fri, 9 Jan 2026 18:20:47 +0000 Subject: added cv and updated nginx to serve it properly --- nginx.conf | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'nginx.conf') diff --git a/nginx.conf b/nginx.conf index 1eaadc9..6625f7a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,7 +4,6 @@ map $http_user_agent $format_suffix { default ""; } -# Also check for Accept: text/plain map $http_accept $final_suffix { "~*text/plain" ".txt"; default $format_suffix; @@ -15,16 +14,34 @@ server { server_name jayrup.me; root /usr/share/nginx/html; + # Serve PDFs directly + location ~* \.pdf$ { + add_header Content-Type application/pdf; + add_header Content-Disposition inline; + try_files $uri =404; + } + + # /cv should point to the PDF + location = /cv { + try_files + /cv$final_suffix + /cv/index$final_suffix + /cv.pdf + =404; + } + + location / { - # This handles: - # 1. /cv -> /cv.txt (for curl) - # 2. /cv -> /cv.html (for browser) - # 3. /projects/ -> /projects/index.txt (for curl) - try_files $uri$final_suffix $uri.html $uri/index$final_suffix $uri/index.html =404; + try_files + $uri$final_suffix + $uri.html + $uri/index$final_suffix + $uri/index.html + =404; } - # Ensure text files are served correctly location ~* \.txt$ { add_header Content-Type text/plain; } } + -- cgit v1.2.3