NGINX ERR_TOO_MANY_REDIRECTS - 反向代理上重定向错误过多

NGINX ERR_TOO_MANY_REDIRECTS - 反向代理上重定向错误过多

我安装了带有 NGINX 的 Debian 11 代理。该代理指向我的后端服务器 10.0.0.120。

NGINX的配置default

#
# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name     jellyfruit.com www.jellyfruit.com *.jellyfruit.com;
    return 301 https://www.jellyfruit.com$request_uri;
}

server {
    listen [::]:443 ssl;
    listen 443 ssl;

    ssl_certificate /etc/letsencrypt/live/jellyfruit.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/jellyfruit.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    server_name     www.jellyfruit.com;
    location / {
            proxy_pass      http://10.0.0.120;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {
        root http://10.0.0.151;
        access_log off;
        expires max;
    }

    client_max_body_size 2000M;
}

访问网站时出现ERR_TOO_MANY_REDIRECTS。它不断www.jellyfruit.com循环调用。

非常感谢您的帮助。

相关内容