From db1875a745f248b1d185803f31ebe202a9912d41 Mon Sep 17 00:00:00 2001 From: Matiss Jurevics Date: Sat, 27 Dec 2025 20:57:46 +0000 Subject: [PATCH] fixed gittea not showing --- Dockerfile | 1 + nginx.conf | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 03d818e..c8d22e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN bun run build FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..21eb10d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,32 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Gitea API proxy + location /api/gitea { + rewrite ^/api/gitea(.*)$ $1 break; + proxy_pass https://git.mati.ss; + proxy_http_version 1.1; + proxy_set_header Host git.mati.ss; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # CORS headers (if needed) + add_header Access-Control-Allow-Origin * always; + add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always; + add_header Access-Control-Allow-Headers "Authorization, Content-Type" always; + + if ($request_method = OPTIONS) { + return 204; + } + } + + # Serve static files + location / { + try_files $uri $uri/ /index.html; + } +} +