so I am trying to host a website with nginx. For the first month it was working, until I tried to add a new domain. By default the domain was not working ( It was just showing content of the default server block ), and certbot was failing to authenticate it, so I tried to remove all certs and try again, but that screwed everything up and nothing works now. It fails to connect to any of the domains. I got rid of the port 443 and all that in the server blocks and it still doesn't work, even though it says that it is listening on port 80. I have also allowed port 80 and 443 through the firewall as well as allowed nginx through. Here is the sites-enabled/default config:
server {
listen 80 ;
listen [::]:80;
server_name aphrim.dev www.aphrim.dev; # managed by Certbot
root /var/www/aphrim.dev/html;
index index.html index.htm index.nginx-debian.html;
}
server {
listen 80 ;
listen [::]:80;
server_name projects.aphrim.dev; # managed by Certbot
root /var/projects/aphrim.dev/html;
index index.html index.htm index.nginx-debian.html;
}
server {
listen 80;
listen [::]:80;
server_name techchan.org;
root /var/projects/aphrim.dev/html;
index index.html index.htm index.nginx-debian.html;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Any help or ideas would be greatly appreciated, I have spent the past day trying to get this working, but to no avail.
Some other weird things, before deleting the certs, if I were to put 443 listener on the new domain, it worked fine, but was still unable to access through http/port 80. I am also unable to gen the certs as it says there is a connection timeout when trying to authenticate.