Want to subscribe to topics you're interested in?
Become a Member

PHP-FPM why get a redirect loop

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by ahmed, May 9, 2017.

  1. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:02 AM
    Code:
    server {
    listen 127.0.0.1:8080;
       server_name DOMAIN www.DOMAIN;
    #http2_max_field_size 16k;
     # http2_max_header_size 32k;
    
      root /home/nginx/domains/DOMAIN/public;
       index index.php;
       port_in_redirect off;
    
       location / {
          try_files $uri $uri/ /index.php?$args;
       }
    
      include /usr/local/nginx/conf/staticfiles.conf;
    
    #a trial to include more php
    ####include /usr/local/nginx/conf/php-wpsc.conf;
    
     location ~ \.php$ {
     try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
           include fastcgi_params;
          fastcgi_index index.php;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param HTTPS on;
    
            fastcgi_pass 127.0.0.1:9000;
    }
    }
    
    THhe above server block which is the back end of varnoish works fine, do I need to put more security on it?
    any way I tried to include the php-wpsc.conf; but I get "redirect loop"
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    11:02 AM
    Nginx 1.13.x
    MariaDB 5.5
    remove
    Code (Text):
     location ~ \.php$ {
     try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
          include fastcgi_params;
         fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param HTTPS on;
    
           fastcgi_pass 127.0.0.1:9000;
    }
    

    that is already contained in /usr/local/nginx/conf/php-wpsc.conf or /usr/local/nginx/conf/php.conf
     
  3. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:02 AM
    yes, that what I did, I commented it using #

    however getting the loop
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    11:02 AM
    Nginx 1.13.x
    MariaDB 5.5
    then redirect loop is related to something else

    Centmin Mod is provided as is, so as you have varnish in front, you'd have diagnose where the redirect loop is coming from yourself
     
    • Like Like x 1