I have 2 external IP addresses on the VM that I’m running my production environment on. I have used the procedure outlined in the Corteza documentation to install NGINX and Corteza on the server, and set the .env file to one of the external IPs, but I want to host a separate instance of NGINX that will serve up web pages when requests come in to the other external IP address (port 80 and 443).
My questions:
-
Will there be a problem running 2 NGINX containers if each is listening to a separate IP address?
-
What do I need to do to get the currently installed NGINX (my-proxy) to listen to a particular IP address?
there are not problem you can, and for external ip you can use other port for nginx, example, in one container use port 80 or 443, in other container use 14571 1572EXAMPLE, with 1 ip you can have 10 or 20 nginx with diferent port, example
docker run --name container one -p 14572:80 nginxone
docker run --name container two-p 14585:80 nginxtwo
docker run --name container three -p 14598:80 nginxthree
and if you want use domain in the future you need only one nginx
nginx on port docker run-p 80:80 and -p 443:443 and for each corteza use one domain
corteza one with por 8457 proxy-domain cortezaone.yourdomain.tld
corteza two with por 8444 proxy-domain cortezatwo.yourdomain.tld
- Will there be a problem running 2 NGINX containers if each is listening to a separate IP address?
no problem
- What do I need to do to get the currently installed NGINX (my-proxy) to listen to a particular IP address?
It depend, Do you use docker compose or not?
you can use 10 corteza-app or much more with only one nginx and with only one ip
with the same nginx you can use one corteza with ip and other corteza with domain
Yes, I’m using docker compose. Standard install for Corteza.
Ok, when you use docker compose it is a little more complicated to use multiple corteza-app, to manipulate nginx you will have to have knowledge of bash from the Linux terminal, and edit it with the terminal because with nginx there is no graphical interface, and in the docker you no have access to ftp in this case with docker compose, do you have knowledge of bash from the Linux terminal?, wait some minutes i will send you some commands to you, may it can help you
From what I’ve read, I just need to add a listen statement to the nginx .env file to direct incoming requests to the correct nginx container. Does that sound right?
yes copy your nginx configuration from the previus corteza, change de port, use other port for the new corteza, and add domain if you have domain,
docker run -ti your_nginx_container bash
cd /etc/nginx/conf.d
cp contezaconfig.conf newcorteza.conf
and edit it with your need, with domain or without domain
and for you new docker (this is only example for your new corteza without docker compose, and to use with the same nginx) and for your --net use the same one that created docker-compose to see it execute = docker network ls
docker run -ti --name=cortezanew -p 10980:80 -v /opt/corteza/data:/data --env-file=“your.env” --net local-net-same-net-your-previus-corteza --ip 172.18.0.150 cortezabuilder:9.8
the ip must belong to the --net range
to see it execute = docker network inspect your-net-with-docker-compose ls (your-net-with-docker-compose =previus resul from docker network ls)
(This tutorial is to use the same installation you already have with the same nginx, and with the same IP range of your previous installation. )
1 Like