【发布时间】:2020-09-26 17:14:39
【问题描述】:
我正在通过 AWS 使用 gunicorn 和 nginx 启动一个 Django 应用程序。我没有错误地设置了 gunicorn 配置。我在 /etc/nginx/sites-enabled 中创建了一个新的 nginx 配置,然后运行 sudo nginx -t 进行测试,我收到以下错误: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
我在etc/nginx/nginx.conf 的nginx 配置中取消了server_names_hash_bucket_size: 64 的注释,这仍然没有改变我的错误,我无法重新启动我的服务器(我正在尝试设置一个主管以确保gunicorn 始终在后台运行)
供参考:
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;
}
}
我也跑了systemctl status nginx.service:
我是服务器故障排除的新手,非常感谢您的帮助
【问题讨论】:
-
你能看一下这个问题的解决方案吗? stackoverflow.com/questions/13895933/…