From a2fac7bc0b1a5d825b8ed8d07923a17cb16dc32c Mon Sep 17 00:00:00 2001 From: CaptainJack2491 Date: Sat, 27 Dec 2025 16:39:29 +0000 Subject: inital commit --- nginx.conf | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 nginx.conf (limited to 'nginx.conf') diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..cf4b30e --- /dev/null +++ b/nginx.conf @@ -0,0 +1,48 @@ +server { + listen 80; + server_name jayrup.me; + + root /usr/share/nginx/html; + index index.html; + + # Helper variable: detect text clients + set $want_text 0; + + if ($http_user_agent ~* "(curl|wget)") { + set $want_text 1; + } + + if ($http_accept ~* "text/plain") { + set $want_text 1; + } + + # Home + location = / { + if ($want_text) { + rewrite ^ /index.txt break; + } + try_files /index.html =404; + } + + # Projects + location = /projects { + if ($want_text) { + rewrite ^ /projects.txt break; + } + try_files /projects.html =404; + } + + # CV + location = /cv { + if ($want_text) { + rewrite ^ /cv.txt break; + } + try_files /cv.html =404; + } + + # Force correct type for text files + location ~ \.txt$ { + default_type text/plain; + } +} + -- cgit v1.2.3