django - Nginx 无法启动高性能 Web 服务器和反向代理服务器

标签 django ubuntu nginx

关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。












此问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-topic在这里,这个问题的解决方式不太可能帮助 future 的读者。


3年前关闭。







Improve this question




我在 ubuntu 中的整个网站都关闭了。当我检查状态时。我得到:

Aug 30 21:39:44 ubuntu-s-1vcpu-2gb-nyc1-01 nginx[23017]: **nginx: [emerg] "worker_processes" directive invalid value in /etc/nginx/nginx.conf:2**
Aug 30 21:39:44 ubuntu-s-1vcpu-2gb-nyc1-01 nginx[23017]: nginx: configuration file /etc/nginx/nginx.conf test failed
Aug 30 21:39:44 ubuntu-s-1vcpu-2gb-nyc1-01 systemd[1]: nginx.service: Control process exited, code=exited status=1
Aug 30 21:39:44 ubuntu-s-1vcpu-2gb-nyc1-01 systemd[1]: **Failed to start A high performance web server and a reverse proxy server.**

这是我的/etc/nginx/nginx.conf:
user www-data;
worker_processes autoi;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

最佳答案

worker_processes 应该是“auto;”你写了autoi;与“我”

关于django - Nginx 无法启动高性能 Web 服务器和反向代理服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52106236/

相关文章:

python - Django with MySQL : OperationalError (1054, "Unknown column ' ' in 'where clause' ") 当试图查询多对多关系时

Django:admin 中的 MultipleChoiceField 用于继承以前保存的值

c++ - 如何让FLTK 1.3.0在Ubuntu Linux中支持中文?

python - PyGears 不生成输出 HDL 文件

amazon-s3 - 什么是 RESTful Web 服务最具可扩展性和高性能的 Amazon Web Service (AWS) 配置?

Django 模板对象类型

python - 部署到 heroku 的 Django 错误

c++ - 无法在 ubuntu 20.04 中安装 g++

linux - 'No package nginx available' 错误 CentOS 6.5

python - 由于 ModuleNotFoundError : No module named 'wsgi' ,Flask 无法使用 Docker 启动服务器