python - nginx:[警告] 0.0.0.0:80 上的冲突服务器名称 "example.com",已忽略

标签 python django nginx deployment

当我尝试重启 nginx 时,出现以下错误

nginx: [warn] conflicting server name "example.io" on 0.0.0.0:80, ignored

我使用我的部署脚本为 2 个域进行部署。首先,它工作正常,但其次,它会出错。

这是我的 nginx.conf 文件

#
worker_processes 2;

#
user nginx nginx;

#
pid /opt/nginx/pids/nginx.pid;
error_log /opt/nginx/logs/error.log;

#
events {
    worker_connections  4096;
}

#
http {
    #
    log_format full_log '$remote_addr - $remote_user $request_time $upstream_response_time '
                        '[$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';

    #
    access_log  /opt/nginx/logs/access.log;

    ssl on;
    ssl_certificate /opt/nginx/cert/example.crt;
    ssl_certificate_key /opt/nginx/cert/example.key;

    #
    include /opt/nginx/conf/vhosts/*.conf;

    # Deny access to any other host
    server {
        server_name example.io;  #default
        return 444;
    }
}

最佳答案

不确定,但尝试在

中更改服务器名称

/etc/nginx/sites-enabled/default

应该有帮助

关于python - nginx:[警告] 0.0.0.0:80 上的冲突服务器名称 "example.com",已忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39752864/

相关文章:

python - Pandas read_csv 中的复杂分隔列

python - 使用 scipy 的低阶近似

python - page() 接受 1 个位置参数,但给出了 2 个

python - 属性错误: 'unicode' object has no attribute '_meta'

php - 什么是 www.conf?

redirect - Nginx:301 从外部文件重定向

python - 在 Django ORM 中插入数据时跳过值以避免重复错误

python - Gstreamer 在 EOS 之前动态更改源

python - 如何从外部脚本更新 haystack 的索引?

http - 我是否应该始终为 Web 应用程序使用反向代理?