0

I have a Nginx web server working as a proxy server. It proxy two different web servers one IIS and the other GitLab server. The first virtual address works with no problems but the second does not work. I have included my config below. This config was previously working. I have moved the servers from one server to another. All that has changed is the internal IP Address of the servers. The servers themselves are working properly.

    server {

    server_name vcontrol.mysite.uk;

    location /.well-known {
        alias /var/www/defaultcertbot/.well-known;
    }

        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.0.32;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/vcontrol.mysite.uk/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/vcontrol.mysite.uk/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    if ($host = vcontrol.mysite.uk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;

    server_name vcontrol.mysite.uk;
    return 404; # managed by Certbot
}

server {

    server_name mysite.uk  www.mysite.uk;

    location /.well-known {
        alias /var/www/defaultcertbot/.well-known;
    }
    location / {
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.168.0.33;
    }    

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mysite.uk/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mysite.uk/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = mysite.uk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = www.mysite.uk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;

    server_name mysite.uk www.mysite.uk;
    return 404; # managed by Certbot

}

The 172.168.0.33 is the IIS server and the one that is not resolving the site. Bindings on the site are correct and the URL's resolve to the right IP Address. To check the IIS server. I have changed the vcontrol internal IP to 33 and it does show the IIS site. The config issue must be in the default site config.

Any help would be apricaited

1 Answers1

2

The configuration is fine. The problem was on the router I had inputted the IP address incorrect.