Назад | Перейти на главную страницу

Цикл перенаправления - AWS ELB SSL Nginx

У нас есть сертификат, установленный на ELB, предоставляемый сервисами сертификации AWS, также самозаверяющий сертификат настроен на веб-сервере Nginx. Теперь, когда пользователь заходит в https://www.example.org/ это говорит

www.example.org слишком много раз перенаправлял вас. ERR_TOO_MANY_REDIRECTS

Ниже приведен мой файл конфигурации nginx

server {
    listen 80;
    listen 443 ssl;
    server_name example.org www.example.org *.example.org;

    access_log /var/www/example.org/logs/access.log;
    error_log /var/www/example.org/logs/error.log;
    root /var/www/example.org/httpdocs;

    ssl_certificate      /etc/nginx/ssl/new/example.org.crt;
    ssl_certificate_key  /etc/nginx/ssl/new/example.org.key;
    ssl_protocols        TLSv1 TLSv1.1 TLSv1.2;

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }

    location @handler {
        rewrite / /index.php;
    }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }

        expires        off;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}