diff --git a/nginx/kitspace.template b/nginx/kitspace.template index d434d83f31..4a4e3caaf4 100644 --- a/nginx/kitspace.template +++ b/nginx/kitspace.template @@ -40,7 +40,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; @@ -59,6 +60,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 {