2016-11-22 29 views
0

私のlaravelアプリケーションを自分のDigital Oceanドロップレットにアップロードしようとしています。nginx&laravel:内部的に "/index.php"にリダイレクトしている間のリライトまたは内部リダイレクトサイクル

私はこれに続いてtutorialとなっていますが、今は500サーバのエラーが発生しています。ここ

は私のnginxののerror.logである:

2016/11/22 02:21:30 [error] 7733#7733: *1 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 198.7.58.98, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:25:05 [error] 7733#7733: *2 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 52.71.155.178, server: antique.samiemad.me, request: "GET /robots.txt HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:25:05 [error] 7733#7733: *3 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 52.71.155.178, server: antique.samiemad.me, request: "GET /info.php HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:30:53 [error] 7733#7733: *4 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 198.7.58.98, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:32:30 [error] 7733#7733: *5 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 52.71.155.178, server: antique.samiemad.me, request: "GET /info.php HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:35:52 [error] 7733#7733: *13 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 188.227.78.184, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:35:52 [error] 7733#7733: *14 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 188.227.78.184, server: antique.samiemad.me, request: "GET /favicon.ico HTTP/1.1", host: "antique.samiemad.me", referrer: "http://antique.samiemad.me/" 
2016/11/22 02:44:56 [error] 7733#7733: *15 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 198.7.58.98, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 02:57:59 [error] 7733#7733: *17 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 198.7.58.98, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 
2016/11/22 03:02:30 [error] 7733#7733: *18 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 198.7.58.98, server: antique.samiemad.me, request: "GET/HTTP/1.1", host: "antique.samiemad.me" 

私は、このエラーのために周りに検索し、私は私のサイトで入手可能な「ファイルに何か問題がなければならないと思います。私はそこでいくつかの価値を持って遊んだりしようとしましたが、まだそれを働かせることができませんでした。ここ

が私のサイト利用可能/ antique.samiemad.me "の現在の内容です:

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

    root /var/www/antique.samiemad.me/public; 
    index index.php index.html index.htm; 

    server_name antique.samiemad.me; 
    charset utf-8; 

    gzip on; 
    gzip_vary on; 
    gzip_disable "msie6"; 
    gzip_comp_level 6; 
    gzip_min_length 1100; 
    gzip_buffers 16 8k; 
    gzip_proxied any; 
    gzip_types 
     text/plain 
     text/css 
     text/js 
     text/xml 
     text/javascript 
     application/javascript 
     application/x-javascript 
     application/json 
     application/xml 
     application/xml+rss; 

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

    location ~ \.php\$ { 
     try_files \$uri /index.php =404; # tried to comment-out this line.. no luck :(
     fastcgi_split_path_info ^(.+\.php)(/.+)\$; 
     fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; 
     include fastcgi_params; 
    } 

    location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ { 
     expires 1M; 
     access_log off; 
     add_header Cache-Control "public"; 
    } 

    location ~* \.(?:css|js)\$ { 
     expires 7d; 
     access_log off; 
     add_header Cache-Control "public"; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 

} 

私は多分問題はtry_filesコマンドの一つであると思いますか? 私はコードで指摘された行をコメントアウトしようとしましたが、私はまだ同じエラーがあります。だからこれを引き起こす何か他のものでなければならない。

答えて

0

..「\」いくつかの「$」サインの前に、問題は、私が持っていたということでしたが判明、私はそれらを削除し、それが魅力のように働きました。

チュートリアルの著者に連絡してコードを修正します。

+0

私も同じですが(私は 'try_files $ uri $ uri /index.php?$ args;'を持っていますが、私はまだこの厄介なループを手に入れています!また、記事の著者がまだそれを修正していないことを知っていいです=) –

関連する問題