How reach Swagger docs under Traefik proxy?
See original GitHub issueHi! I have docker-compose file with the following services:
services:
reverse-proxy:
image: traefik:v2.4
container_name: reverse-proxy
command:
- "--api.insecure=true"
- "--providers.docker"
ports:
- "80:80"
- "8080:8080"
labels:
- traefik.enable=true
- traefik.docker.network=pred-network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- pred-network
api-service:
image: x86_64/prediction-service:0.8.1
container_name: api-service
environment:
SERVING_SERVICE: model-service
expose:
- 8000
labels:
- traefik.enable=true
- traefik.http.routers.api-service.rule=Host(`api.service.localhost`)
networks:
- pred-network
Container api-service has python script with one path for POST requests: http://api.service.localhost/predict/. This path works perfectly for POST requests. It looks like Swagger docs should be under http://api.service.localhost/docs/. But when I go to this page I am getting:
Not Found
HTTP Error 404. The requested resource is not found.
Environment:
python==3.8
uvicorn==0.13.4
fastapi==0.63.0
python-multipart==0.0.5
numpy~=1.19.5
Pillow==7.0.0
min-tfs-client==1.0.2
I would appreciate any ideas!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Swagger UI adds a :80 to the request url when used with https ...
My app is based on an microservice architecture all are running in docker containers with Traefik as a reverse proxy. when I try...
Read more >API Portal - Traefik Labs documentation
Traefik Enterprise includes an API Portal which groups all the API specifications from your services into a web UI. Read the docs to...
Read more >Swagger, Spring Boot 2 With a Reverse-Proxy in Docker
This article demonstrates how you can set up Spring Boot 2 with Swagger behind a reverse-proxy locally using NGINX and Docker.
Read more >Behind a Proxy - FastAPI
In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration that adds an extra path...
Read more >Implement Træfik Into API Platform Dockerized
Use this custom API Platform docker-compose.yml file which implements ready-to-use Træfik container configuration. Override ports and add labels to tell Træfik ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Removing the trailing slash does not help 😦
@gyKa Thanks. I added
app = FastAPI(root_path="/api/v1")
to script but I still cannot connect.Also tried to change docker-compose so webapp could have only two pathes:
But it does not work either
Here is my updated docker-compose file: