V
V
Viktor Yanyshev2019-09-24 20:25:45
Nginx
Viktor Yanyshev, 2019-09-24 20:25:45

Proxying from a host to a container, is it necessary to create a docker network?

In general, on the vps, nginx, postgres, matrix are spinning. I need to run a copy of matrix for tests on the same vps. Therefore, I decided that:
- create a new database on the host and forward the Postgres port to the container (expose 5432)
- create a new nginx host config and proxy to the container (-p8848:8008)
- deploy the matrix in the container
- start the container with -d
As a result, I got:

<br>
docker run -d -it \<br>
--name matrix_dev \<br>
-- expose 5432 \<br>
-p"127.0.0.1:8848:8008" \<br>
villiwalla/matrix-synapse<br>

It seemed to me that this should have ended. First of all, I decided to check nginx
curl -XGET localhost:8848/_matrix/static
. The logs show that proxy_pass localhost:8848
Proxies to localhost , which throws 502 in response
. Do I need to figure out port 80? And is it necessary to create a Docker network in this case?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question