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.
Syntax errors in nginx.conf after updating configuration template
Syntax errors in nginx.conf after updating configuration template
After updating a configuration template that was being used, Vesta generated a nginx configuration file with syntax errors. It appeared that it started writing to the file at the wrong offset, resulting in a server block that started inside the previous one.
I suspect that the solution in viewtopic.php?f=11&t=13778&start=10 would fix the problem, though I fixed it temporarily by grabbing the nginx.conf and snginx.conf files from the most recent backup. I don't want to run a full configuration rebuild on a production site if I can prevent it. Is this a known bug, or is there a way to prevent it from happening again?
Here is a snippet from the faulty file:
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
server {
listen <deleted IP>:80;
server_name <deleted hostname>;
I suspect that the solution in viewtopic.php?f=11&t=13778&start=10 would fix the problem, though I fixed it temporarily by grabbing the nginx.conf and snginx.conf files from the most recent backup. I don't want to run a full configuration rebuild on a production site if I can prevent it. Is this a known bug, or is there a way to prevent it from happening again?
Here is a snippet from the faulty file:
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
server {
listen <deleted IP>:80;
server_name <deleted hostname>;
Re: Syntax errors in nginx.conf after updating configuration template
Show please output:
Code: Select all
nginx -t
Re: Syntax errors in nginx.conf after updating configuration template
With the currently-in-place file from backup:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
With the broken file in place, there would be an error stemming from the error in the file's syntax.
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
With the broken file in place, there would be an error stemming from the error in the file's syntax.
Re: Syntax errors in nginx.conf after updating configuration template
How your config was broken first time?After updating a configuration template that was being used, Vesta generated a nginx configuration file with syntax errors
Check your template, error was there, eh?
Re: Syntax errors in nginx.conf after updating configuration template
It was broken the first time after I added two lines to /usr/local/vesta/data/templates/web/nginx/php-fpm/mysite-stage-nossl.tpl , then saved a small change to the domain's settings in the Vesta panel so that the change would take effect.
When I've done this before, it has regenerated that section of the configuration file without errors. This last time, it corrupted the file at /home/admin/conf/web/nginx.conf.
I found out early on when testing Vesta that attempting to edit the nginx configuration files in /home/<user>/conf/web manually would result in this sort of corruption, so none of that was done.
When I've done this before, it has regenerated that section of the configuration file without errors. This last time, it corrupted the file at /home/admin/conf/web/nginx.conf.
I found out early on when testing Vesta that attempting to edit the nginx configuration files in /home/<user>/conf/web manually would result in this sort of corruption, so none of that was done.