I get a 405 when trying to send a POST request

custom api works right in localhost. But it is sending 405 error when deploying on VPS containerized with Docker. Why does it happen and how can I fix it?