0

I am launching a Django application using gunicorn and nginx through AWS. I set up the gunicorn configurations with no errors. I created a new nginx configuration in /etc/nginx/sites-enabled and I ran sudo nginx -t to see test and I get the following errors:
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64 nginx: configuration file /etc/nginx/nginx.conf test failed

I uncommented the server_names_hash_bucket_size: 64 in nginx configurations at etc/nginx/nginx.conf and this still does not change my error and I am not able to restart my server (I am trying to set up a supervisor to ensure gunicorn is always running in the background)
For reference:
django.conf:

server { 
   listen 80; server name 34.212.49.238; 
   location / { 
      include proxy_params; 
      proxy_pass http://unix:/home/ubuntu/Django_webapp/app.sock; 
   } 
} 

I also ran systemctl status nginx.service:
enter image description here

I am a novice at server troubleshooting and really appreciate your help

MaartenDev
  • 5,631
  • 5
  • 21
  • 33
Krutheeka
  • 11
  • 3
  • Can you take a peek at solutions in this question? https://stackoverflow.com/questions/13895933/nginx-emerg-could-not-build-the-server-names-hash-you-should-increase-server – zedfoxus Jun 07 '20 at 19:09

1 Answers1

0

Solved it
I created an older config file in etc/nginx/sites-available which I had deleted. But used the same code in a new config file (same DNS, port, etc.). While the config file was deleted from etc/nginx/sites-available, it still existed in etc/nginx/sites-enabled. So double-check all changes made in either of these files are reflected on the other.

Krutheeka
  • 11
  • 3