This is most likely happening because of the long domain name. You can fix this by adding
server_names_hash_bucket_size 64;
at the top of your http block (probably located in /etc/nginx/nginx.conf). I quote from the nginx documentation what to do when this error appears: In this case, the directive value should be increased to the next power of two. So in your case it should become 64.
If you still get the same error, try increasing to 128 and further.
Reference: http://nginx.org/en/docs/http/server_names.html#optimization
/etc/nginx/nginx.conf with write privilegesserver_names_hash_bucket_size 64;
sudo service nginx restart
If the error still persists:
server_names_hash_bucket_size in steps 128, 256, 512, and so on (increasing by a power of 2 each time). eg. server_names_hash_bucket_size 128;
This sounds perhaps a bit random, but it might help an nginx newb like myself.
I got this error when I left off a ; on the server_name line.
had:
server_name www.mydomain.com
access_log /var/log/nginx/www.mydomain.com;
fix:
server_name www.mydomain.com;
access_log /var/log/nginx/www.mydomain.com;
All directives in nginx config files must end with a ;
I often highlight ;s in my file before saving/uploading as a final check after editing.
This is how I solved:
cd /etc/nginx/
sudo nano nginx.conf
cd /etc/nginx/sites-available/
sudo nginx -t
sudo service nginx restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With