I’ve changed computers. I had backups of nginx.conf & the files in sites-available. After installing nginx and certbot on the new computer, I copied nginx.conf and the appropriate files (which contain the LetsEncrypt references) to sites-available and created the links to them in sites-enabled. I’ve tried running “nginx -t” but it has problems with nginx.conf presumably due to the LetsEncrypt files being missing. How do I reinstall the LetsEncrypt files on the new computer?
Hey @ManagerServerRose! This seems more like a LetsEncrypt question. I would suggest asking in their forum. If you don’t have access to the original certs, my go to solution would be to get a new set of certs by going through certbot again, but the folks over at LetsEncrypt might have better suggestions than I ![]()
Thanks. The problem was having certbot lines in the 2 virtual server files I removed them and ran “cerbot –nginx -d johnrose.mywire.org -d roseserver.mywire.org” which created the appropriate LetsEncrypt files and put lines referencing them in the 2 Virtual Host files. However, “nginx -t” gave:
manager@Server:~$ sudo nginx -t
2025/08/13 12:02:03 [warn] 43701#43701: conflicting server name “” on 0.0.0.0:80, ignored
2025/08/13 12:02:03 [warn] 43701#43701: conflicting server name “roseserver.mywire.org” on 0.0.0.0:80, ignored
2025/08/13 12:02:03 [warn] 43701#43701: conflicting server name “” on [::]:80, ignored
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Should the 2 Virtual Host files be different in some way in order to avoid this problem?
PS I’ve attached the 2 files, with .txt added to their filenames.
roseserver.mywire.org.txt (1.3 KB)
johnrose.mywire.org.txt (1.2 KB)
Yup! You want to avoid having multiple server blocks (a.k.a. vHosts) in NGINX listening on the same port using the same server name. In this case you do not define a listen directive in the first server block, so NGINX defaults to port 80:
server {
server_name roseserver.mywire.org;
root /home/manager/www/html;
...
You then have a different code block where you listen on port 80 and use the same server name:
server {
server_name roseserver.mywire.org;
listen 80;
}
Each server block needs to have a unique combination of listening port and server name.
While at it, you also have some blocks that you really don’t need. This block here does nothing so you can probably get rid of it:
server {
listen 80;
listen [::]:80;
}
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.