If using vi, start with: vi /etc/nginx/sites-enabled/01-hp_wfx
within the editor, use the arrows to find your way to the /worldfixer.com
placing yourself at the "w", press the "i" [to insert]
type:
"www."
press ESC [to exit from inserting]
do the same on both lines
When all looks correct, press ESC then ":wq" and ENTER
[that last ESC is just for good measure]
NOTE: Isn't a forum for "how to use a text editor"
But we continue to go above and beyond...
No, I think it did as I did the command cat /etc/nginx/sites-enabled/01-hp_wfx again and it showed the lines with www in front.
Here's the one you requested:
root@wfx-prod:~# grep -i include /etc/nginx/*
grep: /etc/nginx/conf.d: Is a directory
grep: /etc/nginx/modules-available: Is a directory
grep: /etc/nginx/modules-enabled: Is a directory
/etc/nginx/nginx.conf:include /etc/nginx/modules-enabled/*.conf;
/etc/nginx/nginx.conf: include /etc/nginx/mime.types;
/etc/nginx/nginx.conf: include /etc/nginx/conf.d/*.conf;
/etc/nginx/nginx.conf: include /etc/nginx/sites-enabled/*;
grep: /etc/nginx/sites-available: Is a directory
grep: /etc/nginx/sites-enabled: Is a directory
grep: /etc/nginx/snippets: Is a directory
Ok, to clarify that I understand, essentially within the data via the command: sudo grep -R worldfixer.com /etc/nginx
I get these
/etc/nginx/sites-enabled/01-hp_wfx.save: server_name beta.worldfixer.com worldfixer.com www.worldfixer.com 134.122.77.70;
/etc/nginx/sites-enabled/01-hp_wfx.save: ssl_certificate /etc/letsencrypt/live/worldfixer.com/fullchain.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx.save: ssl_certificate_key /etc/letsencrypt/live/worldfixer.com/privkey.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx.save: if ($host = worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx.save: if ($host = www.worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx.save: server_name beta.worldfixer.com worldfixer.com www.worldfixer.com;
and these:
/etc/nginx/sites-enabled/01-hp_wfx: ssl_certificate /etc/letsencrypt/live/worldfixer.com/fullchain.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx: ssl_certificate_key /etc/letsencrypt/live/worldfixer.com/privkey.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx: if ($host = worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx: if ($host = www.worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx: server_name beta.worldfixer.com worldfixer.com www.worldfixer.com;
This is essentially due to the previous duplication of Let's Encrypt certificates.
So I could 'move' these lines
/etc/nginx/sites-enabled/01-hp_wfx.save: server_name beta.worldfixer.com worldfixer.com www.worldfixer.com 134.122.77.70;
/etc/nginx/sites-enabled/01-hp_wfx.save: ssl_certificate /etc/letsencrypt/live/worldfixer.com/fullchain.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx.save: ssl_certificate_key /etc/letsencrypt/live/worldfixer.com/privkey.pem; # managed by Certbot
/etc/nginx/sites-enabled/01-hp_wfx.save: if ($host = worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx.save: if ($host = www.worldfixer.com) {
/etc/nginx/sites-enabled/01-hp_wfx.save: server_name beta.worldfixer.com worldfixer.com www.worldfixer.com;
To somewhere else...like delete them from the existing file by editing the file and removing the lines and then saving them on a local file in case we ever need access to them or should I save them under a different command file?
Move the entire file.
I'm assuming the .save is being used as a backup/copy of the original.
But since it is in the same path/folder, nginx is using both of them.
You can check my logic with: nginx -T
So you mean I should move the files that are inside /etc/nginx/sites-enabled/
Including all of the files ending in:
01-hp_wfx.save:
01-hp_wfx:
worldfixer.com.save.1:
right?
/etc/nginx/sites-enabled/
It seems to make most sense to just remove the files 01-hp_wfx.save:
I think they are just duplicate entities and thus irrelevant. Plus I'm not really sure where exactly I'd move them to.
So I'm planning to do this:
Enter:
vi /etc/nginx/sites-enabled/
And then I'll just delete the option: 01-hp_wfx.save
--will I not blow anything up in the Lets Encrypt world? Once the duplication is gone, then hopefully I can just run the 'renew' command get the certification working again, right?
Don't try to use vi (a text editor) to delete a file.
If you don't need the .save file, use: rm /etc/nginx/sites-enabled/01-hp_wfx.save
[which will permanently remove that file]
Brilliant! Removing the .save file definitely worked. Just ran the renew command and it was able to renew our certification and get the site back up and running.
Thanks so much for the patience and handholding on that. Saved me on my Friday