Is it possible to send an HTTP request from a Docker with a FrontEnd app to another Docker with a BackEnd in the same network when loaded in browser?

Viewed 12

I have a server with a public IP and I want to access via port 443. I also have a public domain resolving to the server's IP. I have 4 dockers in the server:

  • FrontEnd docker: VUE App (port 80:80)
  • BackEnd docker: Django App (port 82:80)
  • DB docker: Postgres DB (port X)
  • Proxy docker: Nginx Proxy Manager (port 81, 443)

Imagine my domain is randomfrontendapp.com. When accessing from a browser to https://randomfrontendapp.com, the Nginx Proxy redirects the request to http://{IP}:80.

When the page is loaded, the FrontEnd makes a call to the BackEnd: http://{IP}:82/givemethings like this: image

There is a problem: The user can't access the BackEnd via HTTP. Maybe the problem can be solved with a subdomain, Nginx Proxy Manager will redirect the request to the backend.

Can it be done without this subdomain?

  1. Access the server from a browser
  2. Click a button that executes a script which makes an http.get to the backend
  3. FrontEnd makes the request to the BackEnd via the Docker network, not forcing the browser to make it from internet.
  4. FrontEnd recieves the information from BackEnd and updates the page.

like this: image2

0 Answers
Related