I rent a V-Server and I got a sub-domain like abc.provider.net. On my server, I set up a set of docker containers using docker-compose providing web apps. Now I want to set up Nginx in order to access them. (Later I want to set up certbot for SSL.)
When setting Nginx
server {
listen 80 ;
listen [::]:80 ;
server_name abc.provider.net;
location / {
proxy_pass http://172.15.12.03:11132;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
}
}
I can reach the app. But I can't set up more.
So I thought to create sub-sub-domains:
server {
listen 80 ;
listen [::]:80 ;
server_name app1.abc.provider.net;
location / {
proxy_pass http://172.15.12.03:11132;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
}
}
But this leads me to:
This site can’t be reached
app1.abc.provider.net refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
How to set up Nginx correctly? Or is this approach not feasible?