0

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?

Alex44
  • 141
  • 8
  • Did you set up corresponding DNS records for the subdomain? – Tero Kilkanen Feb 24 '21 at 18:10
  • Where can I do that? - Btw. I rent a domain now, so this is no longer a problem. But anyhow, I'm interested in a solution. Who knows what's coming next. – Alex44 Feb 27 '21 at 15:10
  • It depends on your registrar how you set up domain name <-> IP address mappings. So, I can only tell that you need to add an entry to DNS that maps the subdomain to the IP address of the server. – Tero Kilkanen Feb 27 '21 at 20:12

0 Answers0