From 201045912d00b33ecb1d9cc0897579d45996db16 Mon Sep 17 00:00:00 2001 From: Arseney300 Date: Sat, 21 Feb 2026 03:31:17 +0700 Subject: Fix jenkins.swave.lol 404 by proxying through /jenkins prefix Jenkins requires --prefix=/jenkins for path-based access on swave.lol. Redirect subdomain root to /jenkins/ and proxy the prefix path to Jenkins, avoiding double-prefix redirect loops. Co-Authored-By: Claude Opus 4.6 --- nginx/nginx.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nginx') diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 9afed4f..ea83fd1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -121,8 +121,14 @@ server { charset utf-8; - location / { - proxy_pass http://jenkins:8080; + # Jenkins requires --prefix=/jenkins, so all URLs must go through /jenkins + # Redirect root to /jenkins, then proxy /jenkins to Jenkins + location = / { + return 302 https://$host/jenkins/; + } + + location /jenkins { + proxy_pass http://jenkins:8080/jenkins; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -- cgit v1.2.3