Docker Compose and Nginx reverse proxy: I can't access the backend through the proxy Docker Compose and Nginx reverse proxy: I can't access the backend through the proxy nginx nginx

Docker Compose and Nginx reverse proxy: I can't access the backend through the proxy


To everyone having the same problem, here is the solution:

  • Delete the access control settings from the nginx config. And Hande the cors within the Nodejs App.
  • If you work with 'localhost' in your nginx.conf configure your NodeJs Express app to work with ipv6 ( instead of .listen('localhost') put .listen('::')).
  • If this problem persist, make sure that you made the first two steps and switch your network mode to host:If you are using Docker compose v2 add 'network_mode : host' for each container. or --network=host for docker run.