Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/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
Unix Nginx错误重定向太多_Unix_Nginx - Fatal编程技术网

Unix Nginx错误重定向太多

Unix Nginx错误重定向太多,unix,nginx,Unix,Nginx,所以我从域中取出了cloudflare CDN,现在我遇到了一个错误:重定向太多。我不确定问题出在哪里,因为我觉得一切都很好。。我可能在其他地方还有其他问题 server { listen 80; listen [::]:80; server_name myweb.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl htt

所以我从域中取出了cloudflare CDN,现在我遇到了一个错误:重定向太多。我不确定问题出在哪里,因为我觉得一切都很好。。我可能在其他地方还有其他问题

server {
        listen 80;
        listen [::]:80;

        server_name myweb.com;
        return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name myweb.com;
    root /home/forge/myweb.com/public;

    ssl_certificate /etc/nginx/ssl/myweb.com/276900/server.crt;
    ssl_certificate_key /etc/nginx/ssl/myweb.com/276900/server.key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!3DES';
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/myweb.com-error.log error;

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

我做错了什么?

尝试在cloudflare中打开https,因为这会导致循环。在off cloudflare中,只使用http,然后重定向到https,这意味着无限循环

尝试在cloudflare中打开https,因为这会导致循环。在off cloudflare中,只使用http,而您重定向到https,这意味着无限循环

cloudflare flexible还是完整SSL?@RichardSmith我禁用了,因为我认为最好使用我自己的letsencrypt端到端证书,对吗?cloudflare flexible还是完整SSL?@RichardSmith我禁用了,因为我认为最好使用我自己的letsencrypt端到端证书,对吗?