# Docker Space POST endpoint 404/HTML error — routing never reaches FastAPI container

**URL:** <https://discuss.huggingface.co/t/docker-space-post-endpoint-404-html-error-routing-never-reaches-fastapi-container/163440>\
**Category:** Spaces\
**Created:** [July 17, 2025, 1:26pm UTC](https://discuss.huggingface.co/t/docker-space-post-endpoint-404-html-error-routing-never-reaches-fastapi-container/163440 "2025-07-17T13:26:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 17, 2025, 1:31pm UTC](https://discuss.huggingface.co/t/docker-space-post-endpoint-404-html-error-routing-never-reaches-fastapi-container/163440/2 "2025-07-17T13:31:25Z")

</div>

> How do I get POST requests routed to my container/app?

It seems that `Post` requests do not go through unless you are using the `hf.space` domain. Like this:

```auto
https://<username>-<space>.hf.space/api/predict

```

> [@FastAPI Routing Issue in Hugging Face Spaces](https://discuss.huggingface.co/t/fastapi-routing-issue-in-hugging-face-spaces/54962):
>
> Hello everyone, I’ve deployed a FastAPI application on Hugging Face Spaces. Everything seems to be running smoothly, and there are no errors in the logs. However, when I try to access my endpoints via a browser or tools like Postman, I’m getting a “404 error” or a “Cannot POST” error. Here’s a brief overview of my setup: I have a FastAPI route defined as @app.get("/check\_request") and another one as @app.post("/recommend"). My Dockerfile specifies the CMD as CMD ["uvicorn", "app:app", "--hos…

---

_[View the full topic](https://discuss.huggingface.co/t/docker-space-post-endpoint-404-html-error-routing-never-reaches-fastapi-container/163440)._
