K
K
ky61k2017-05-29 23:14:58
Nginx
ky61k, 2017-05-29 23:14:58

Nodejs server is running on localhost:3000, nginx+laravel - in Docker containers, how to configure nginx so that site.com/api would refer to the node?

I'm doing a project on a local machine.
Node js dev server ( create-react-app ) started without Docker.
Docker running Lara, nginx, php-fpm, MySql (I used Laradock )
I want to use Node server + React for frontend and Laravel for backend.
Difficulties with setting it up on the Local machine, I think there will be no problems on the VPS,
since the ip is known there and you can specify the IP in the nginx settings.
And on the local machine 127.0.0.1 and in the docker container the same is 127.0.0.1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
chupasaurus, 2017-05-30
@ky61k

By default, container networking is in --net="bridge" mode, which makes direct communication with the host more difficult. If the server on the node is not wrapped in a container, the steps below will also have to be carried out to deploy there.
In my fork of Laradock:

K
ky61k, 2017-06-01
@ky61k

Ultimately, I put the Node server in the Docker container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question