-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger redirects to port 8080 when using BASE_URL #4385
Comments
@maximelebastard, I think this is an issue with your proxy setup - it should handle rewriting Swagger UI's URLs based on what your user is seeing. Per this Server Fault answer, can you try changing your
|
Same issue. Without docker. nginx config like: location / { If i request https://example.com/swagger i get redirect to https://example.com:80/ui/swagger/ui/index Please fix issue that was reported almost one year ago. |
I also would like to see this issued fixed. |
Almost killed myself because I thought it was my API Gateway that was doing this. |
@danielpsf please don't kill yourself over software, it's not worth it. |
Add As workaround for docker-compose you can use version: '3.5'
services:
gateway:
build: ./nginx
ports:
- "80:80"
- "443:443"
links:
- swaggerui
swaggerui:
image: swaggerapi/swagger-ui
restart: always
environment:
- BASE_URL=/swagger
command: ['/bin/sh', '-c', 'sed -i "s|location \/ {|location \/ {\nport_in_redirect off;\n|g" /etc/nginx/nginx.conf && /usr/share/nginx/run.sh'] |
not (.) -> (,) between sh and -c |
I'm having the same issue and not using docker, just straight node locally. Why is it doing a redirect to /docs/ from /docs? Just load the content? Also this breaks things in a Lambda environment as the deployment stage is required after the baseUrl (e.g. https://host.com/dev/docs, it redirects to https://host.com/docs/) |
Configuration (browser query string, constructor, config.yaml)
Docker-compose.yml
nginx.conf
BUT when I add a final slash
curl -v http://doc.dev/swagger/ # I get the swagger app
Expected Behavior
It should work for http://doc.dev/swagger and http://doc.dev/swagger/ (with final slash) as well
Current Behavior
When not adding a final slash, we are redirected to 8080
Context
I have to explain this strange behavior to my teammates and to take care of the links I send.
The text was updated successfully, but these errors were encountered: