We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
[bug] Vesta adds a random } when changing domain back-end templates
[bug] Vesta adds a random } when changing domain back-end templates
Hey guys,
I've got a new clean Vesta (nginx+php-fpm) installation and only added a few domains and gave them a SSL Let's Encrypt certificate. All my Wordpress sites on it had 404 errors (except for the homepage), which was due missing some nginx rewrite rules. After a lot of googling I found out that the wordpress2.stpl back-end template has those required lines to fix it. However, when changing a domain to that template, which fixes the 404 pages, somehow nginx.conf couldn't be restarted. The boogyman? A random '}' appearing in the nginx.conf.
I didn't alter any code, I only used the GUI and didn't even write any code inside there. So no fingers pointed at me for this error, but somehow the control panel itself produces this bug.
For the record, having a false } inside the nginx.conf file will make the whole server unusable and all websites will be down, obviously.
Update: While writing the reproducing steps below, I remembered I added one line of code manually for each domain. "return 301 https://$server_name$request_uri;" directly the server name line in each server {}. This was the only way I could make all non https and *www.* requests go to the https://domain.tld.
--
Reproducing
To make sure this is an actual bug, I configured a quick new VPS and followed the following steps (similar to my main VPS, regarding the above bug). I could reproduce the bug.
1. Create VPS, Ubuntu 16.04 LTS
2. Install Vesta, default config, except I chose nginx+php-fpm
3. Added a user called 'regulars' (short for 'regular clients', I'm not using the admin account for security reasons')
4. Added 3 domains with the 'regulars' account
5. Gave them Let's Encrypt SSL certificates
6. Added a line ('return 301 https://$server_name$request_uri;') for every server {} block
7. Restarted nginx.conf - Still no problem, all websites now load with https:// by default
8. Changed each domain to 'wordpress2' backend
9. service nginx restart -> To check -> Gave error
10. checked /home/regulars/conf/web/nginx.conf and there were sudden random '}' brackets between server blocks
I've got a new clean Vesta (nginx+php-fpm) installation and only added a few domains and gave them a SSL Let's Encrypt certificate. All my Wordpress sites on it had 404 errors (except for the homepage), which was due missing some nginx rewrite rules. After a lot of googling I found out that the wordpress2.stpl back-end template has those required lines to fix it. However, when changing a domain to that template, which fixes the 404 pages, somehow nginx.conf couldn't be restarted. The boogyman? A random '}' appearing in the nginx.conf.
I didn't alter any code, I only used the GUI and didn't even write any code inside there. So no fingers pointed at me for this error, but somehow the control panel itself produces this bug.
For the record, having a false } inside the nginx.conf file will make the whole server unusable and all websites will be down, obviously.
Update: While writing the reproducing steps below, I remembered I added one line of code manually for each domain. "return 301 https://$server_name$request_uri;" directly the server name line in each server {}. This was the only way I could make all non https and *www.* requests go to the https://domain.tld.
--
Reproducing
To make sure this is an actual bug, I configured a quick new VPS and followed the following steps (similar to my main VPS, regarding the above bug). I could reproduce the bug.
1. Create VPS, Ubuntu 16.04 LTS
2. Install Vesta, default config, except I chose nginx+php-fpm
3. Added a user called 'regulars' (short for 'regular clients', I'm not using the admin account for security reasons')
4. Added 3 domains with the 'regulars' account
5. Gave them Let's Encrypt SSL certificates
6. Added a line ('return 301 https://$server_name$request_uri;') for every server {} block
7. Restarted nginx.conf - Still no problem, all websites now load with https:// by default
8. Changed each domain to 'wordpress2' backend
9. service nginx restart -> To check -> Gave error
10. checked /home/regulars/conf/web/nginx.conf and there were sudden random '}' brackets between server blocks
Re: [bug] Vesta adds a random } when changing domain back-end templates
If editing/adding templates you have to make sure a new line exists at the end, at least that is what solved this exact issue for me.