diff --git a/nginx.conf b/nginx.conf index 64fa8aa..c4dc678 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,6 +28,31 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } + # springdoc-openapi(Swagger) 문서. backend가 직접 서빙하므로 /api 프리픽스 없이 그대로 넘긴다. + location /swagger-ui/ { + proxy_pass http://backend:8080/swagger-ui/; + proxy_set_header Host $host; + 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; + } + + location = /swagger-ui.html { + proxy_pass http://backend:8080/swagger-ui.html; + proxy_set_header Host $host; + 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; + } + + location = /v3/api-docs { + proxy_pass http://backend:8080/v3/api-docs; + proxy_set_header Host $host; + 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; + } + location / { try_files $uri $uri/ /index.html; }