Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redirect Nginx配置无限循环(将HTTP重定向到HTTPS)_Redirect_Ssl_Nginx_Https - Fatal编程技术网

Redirect Nginx配置无限循环(将HTTP重定向到HTTPS)

Redirect Nginx配置无限循环(将HTTP重定向到HTTPS),redirect,ssl,nginx,https,Redirect,Ssl,Nginx,Https,我有点卡住了。我正在Nginx上安装一个新的JTL-Shop3。但每当我调用它时,它就会变成,反之亦然,结果显示错误,因为网页在循环中重定向 这是我的非SSL的nginx配置 # redirect non www to www server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name trendboxx.eu www.trendbox

我有点卡住了。我正在Nginx上安装一个新的JTL-Shop3。但每当我调用它时,它就会变成,反之亦然,结果显示错误,因为网页在循环中重定向

这是我的非SSL的nginx配置

    # redirect non www to www
    server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name trendboxx.eu www.trendboxx.eu;

    return 301 https://www.trendboxx.eu$request_uri;
    }
这里是SSL vhost的配置

   server {
    listen 443 ssl;
    ssl on;

    ssl_certificate /srv/www/trendboxx.eu/certificates/www.trendboxx.eu.crt;
    ssl_certificate_key /srv/www/trendboxx.eu/certificates/www.trendboxx.eu.key;

    server_name www.trendboxx.eu; 

    access_log   /srv/www/trendboxx.eu/logfiles/nginx.access.log;
    error_log    /srv/www/trendboxx.eu/logfiles/nginx.error.log;

    root /srv/www/trendboxx.eu/public_html;

    index index.php;

    location / {
            # try file => folder => JTL-Shop3 Search
            try_files $uri $uri/ /index.php?q=$uri$args;
    }

    # error pages
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
            root /usr/share/nginx/html;
    }

    # JTL-Shop3 expires for static files
    location ~* \.(eot|ttf|woff|css|less)$ {
            expires max;
            add_header Access-Control-Allow-Origin *;
            add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            log_not_found off;
    }
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            log_not_found off;
    }

    # PHP handler
     location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_read_timeout 180;
            proxy_read_timeout 180;
    }


    # deny access to hidden files
    location ~ /\. {
            deny all;
    }
    }

我非常感激关于如何解决这个问题的每一个提示。

如果我尝试访问它,它会像一个符咒一样工作,只有PHP文件似乎会导致这个问题……问题解决了。电子商务软件中的设置错误,该软件试图从HTTPS重定向到HTTP,因此它最终陷入循环。。。