【问题标题】:Nginx ERR_CONNECTION_RESET only one domain nameNginx ERR_CONNECTION_RESET 只有一个域名
【发布时间】:2017-10-10 13:27:40
【问题描述】:

问题 其他站点使用完全相同的配置工作,但一个站点不同并且无法正常工作。浏览器输出 ERR_CONNECTION_RESET。 Nginx 记录 6819 # 0:信号进程已启动。 如果您将服务器 _name 更改为另一个域,那么一切正常。 帮助遇到的人。谢谢。

我的配置 nginx:

server {
    server_name  example.com *.example.com;
    listen 80;
    return 301 https://$host$request_uri;
}

server {
    server_name example.com *.example.com;
    listen       443 ssl http2;
    # resolver 8.8.8.8;
    root /usr/share/nginx/sites/example.com/html;
    keepalive_timeout  65;

    gzip on;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;

    #autoindex on;
    index index.php index.html index.htm;

    ssl on;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    location ~ /.well-known {
        allow all;
    }

    error_page  404              /404.html;
    # proxy the PHP scripts to Apache listening on 127.0.0.1:8080
    #
    location ~ \.php$ {                      
    proxy_set_header Host            $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass   http://127.0.0.1:8080;
 }}

【问题讨论】:

  • 将以下指令添加到events 以获得更详细的错误日志:debug_connection localhost;
  • 我添加了,但不幸的是日志中没有任何变化
  • 网站也ping不通,是nginx吗?
  • 指令必须添加到您的/etc/nginx/nginx.conf 文件序言中的events 部分。之后:使用nginx -t 检查配置,修复任何错误信号或使用nginx -s reload 重新加载服务器,再次尝试获取日志。 does not ping 是什么意思?服务器和 nginx 都在运行吗?尝试设置error_log info 指令

标签: nginx web sites


【解决方案1】:

我解决了这个问题...代理服务器不起作用。掌心。

【讨论】:

    猜你喜欢
    • 2023-03-25
    • 2012-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-07
    • 1970-01-01
    • 1970-01-01
    • 2015-08-10
    相关资源
    最近更新 更多