Nginx ERR_TOO_MANY_REDIRECTS

Nginx ERR_TOO_MANY_REDIRECTS

这是我的配置文件:

server {
        listen 8080 default_server;

        server_name revistacariere.ro www.revistacariere.ro;

        return 301 https://revistacariere.ro$request_uri;
}

server {
    listen 443 ssl;

    server_name revistacariere.ro;

    ssl on;
    ssl_certificate /etc/letsencrypt/live/revistacariere.ro/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/revistacariere.ro/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    root /var/www/html/revistacariere;
    index index.php index.html index.html;    

    access_log /var/log/nginx/revistacariere_access.log;
    error_log /var/log/nginx/revistacariere_error.log error;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ "^(.+\.php)($|/)" {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www/html/revistacariere:/tmp";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_pass 172.17.0.3:9000;
    }

    # Enable caching
    location ~*  \.(jpg|jpeg|png|gif|ico|svg|otf|ttf|woff|css|js)$ {
            expires 365d;
            try_files $uri @assets;
    }
    location @assets {
            rewrite ^ /index.php last;
    }

    # Settings
    client_max_body_size 8M;
}  

添加 SSL 块后,我收到过多重定向错误,但不知道原因。这是一个在 docker 容器内运行的 WP 网站。

相关内容