From 4e87b885d232181b427983bd084627dcb00711f5 Mon Sep 17 00:00:00 2001 From: Abdulrhmn Ghanem Date: Thu, 16 Feb 2023 09:07:54 +0200 Subject: [PATCH] Hide gitea --- nginx/kitspace.template | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nginx/kitspace.template b/nginx/kitspace.template index eeb8357448..bdb7574774 100644 --- a/nginx/kitspace.template +++ b/nginx/kitspace.template @@ -35,7 +35,8 @@ server { return 200 "@KITSPACE_ROBOTS_TXT"; } - location ^~ / { + # Proxy api requests to gitea, otherwise redirect to the apex domain. + location ^~ /api/v1/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -54,6 +55,11 @@ server { } proxy_pass http://gitea:3000; } + + location ^~ / { + # 307 just in case we end up exposing gitea again to avoid caching issues. + return 307 @KITSPACE_URL; + } } server {