Symptoms
After updating to ea-nginx-1.21.0-15 on a CloudLinux server, the error below causes Nginx to fail:
[11:22:32 /etc/nginx/ea-nginx]cPs# nginx -t
nginx: [emerg] invalid number of the map parameters in /etc/nginx/conf.d/ea-nginx.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed
Description
When updating to ea-nginx-1.21.0-15, the /etc/nginx/ea-nginx/settings.json
file is created with null values instead of their usual values:
[12:00:00 ~]cPs# cat /etc/nginx/ea-nginx/settings.json
{
"apache_port" : null,
"apache_port_ip" : null,
"apache_ssl_port" : null,
"apache_ssl_port_ip" : null,
"client_max_body_size" : "128m",
"server_names_hash_max_size" : 1024,
"server_names_hash_bucket_size" : 12
}
Due to this misconfiguration, Nginx's configuration test fails and Nginx is unable to start.
Workaround
A file that contains valid default values is created during the upgrade called settings.json.rpmsave:
[11:29:22 qhs01 root@94344829 /etc/nginx/ea-nginx]cPs# cat /etc/nginx/ea-nginx/settings.json.rpmsave
{"apache_ssl_port_ip": "127.0.0.1", "apache_port": "81", "server_names_hash_max_size": 1024, "apache_port_ip": "127.0.0.1", "server_names_hash_bucket_size": 128, "apache_ssl_port": "444"}
Replacing /etc/nginx/ea-nginx/settings.json
with /etc/nginx/ea-nginx/settings.json.rpmsave
and rebuilding the Nginx configuration should serve as a temporary workaround.
One method of replacing settings.json is by overwriting it with the 'cp' command:
[11:53:31 qhs01 root@94344829 /etc/nginx/ea-nginx]cPs# cp settings.json.rpmsave settings.json
cp: overwrite 'settings.json'? y
[11:57:41 qhs01 root@94344829 /etc/nginx/ea-nginx]cPs# cat settings.json
{"apache_ssl_port_ip": "127.0.0.1", "apache_port": "81", "server_names_hash_max_size": 1024, "apache_port_ip": "127.0.0.1", "server_names_hash_bucket_size": 128, "apache_ssl_port": "444"}
After overwriting settings.json, run the following command to rebuild the Nginx configuration:
/scripts/ea-nginx conf --global
Comments
0 comments
Article is closed for comments.