暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Nginx代理报502

DevOps架构实战 2022-02-28
1562

点击关注公众号

分享到“朋友圈”,每天上午 08:00,干货推送!

查看报错日志

192.168.20.69 - - [24/Feb/2022:10:00:10 +0800] "HEAD / HTTP/1.1" 502 0 "-" "curl/7.29.0" "-"

2022/02/24 10:12:49 [error] 20021#0: *44 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: 192.168.10.105, server: 192.168.20.69, request: "GET / HTTP/1.1", upstream: "https://103.18.208.227:443/v3/index.json", host: "192.168.20.69"

2022/02/24 10:13:11 [error] 20021#0: *44 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: 192.168.10.105, server: 192.168.20.69, request: "GET /favicon.ico HTTP/1.1", upstream: "https://103.18.208.227:443/v3/index.jsonfavicon.ico", host: "192.168.20.69", referrer: "http://192.168.20.69/"

 

[root@mha conf]# curl -I http://192.168.20.69

HTTP/1.1 502 Bad Gateway

Server: nginx/1.21.5

Date: Thu, 24 Feb 2022 02:21:27 GMT

Content-Type: text/html

Content-Length: 157

Connection: keep-alive

 

[root@mha conf]# more nginx.conf

user  root;

worker_processes  auto;

worker_cpu_affinity auto;

worker_rlimit_nofile 40960;

events {

    use epoll;

    worker_connections  40960;

} 

http {

    include       mime.types;

    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

            '$status $body_bytes_sent "$http_referer" '

            '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

    sendfile        on;

    #tcp_nopush     on;

      keepalive_timeout  65;

#增加下面参数:nginxbuffer太小,timeout太小

    client_max_body_size 1024m;

    client_body_buffer_size 10m;

    client_header_buffer_size 10m;

    proxy_buffers 4 128k;

         proxy_busy_buffers_size 128k;

    gzip  on;

    server {

        listen       80;

        server_name  192.168.20.69;

        #charset koi8-r;

        location / {

            root   html;

            index  index.html index.htm;

            proxy_pass https://nuget.cdn.azure.cn/v3/index.json;

       }

    }

include sub/*.conf;

include to_internet/*.conf;

}

文章转载自DevOps架构实战,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论