wmnnd / nginx-certbot

Boilerplate configuration for nginx and certbot with docker-compose
MIT License
3.15k stars 1.17k forks source link

[emerg] 1#1: host not found in upstream hostname.example.com in /etc/nginx/conf.d/app.conf:26 #98

Open MartinX3 opened 3 years ago

MartinX3 commented 3 years ago

Following the instructions I get [emerg] 1#1: host not found in upstream hostname.example.com in /etc/nginx/conf.d/app.conf:26 (hostname.example.com is just an example because I don't want to make my subdomain public registered on a free dyndns service) The dns name is connected with only IPv6. The hostname points to the ocrrect IPv6 and I can use it for every service including ssh.

I fixed this error by including

upstream hostname.example.com {
    server localhost;
}

in the top of data/nginx/conf.d/app.conf

Do you know why this happen? Is my solution just a dirty workaround?

My server is an Arch Linux server running in a proxmox VM in my university. One networkcard is connected with the internal university network and only accessible via VPN. The other networkcard has a public IPv6 address, so I can connect it with my hostname and use it for public internet services.