Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: NGINX: New install, admin redirect loop. Otherwise OK.

    Quote Originally Posted by kelvyn View Post
    _SERVER["PHP_SELF"] /phpinf0.php/phpinf0.php
    There's likely your problem: the needlessly repeated filename in PHP_SELF.

    I seem to recall that Windoze had a bug they had to fix in IIS a couple years back which was doing the same thing.
    Maybe Nginx hasn't caught up yet.


    And, yes, I did mean ActionPoint 110 ... sorry for the confusion. It's moot now anyway.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #2
    kelvyn Guest

    Default Re: NGINX: New install, admin redirect loop. Otherwise OK.

    Quote Originally Posted by DrByte View Post
    There's likely your problem: the needlessly repeated filename in PHP_SELF.
    You beauty! That was it!

    OK, with a few hours and a lot of googling, here's what I got:

    I started here:
    http://forum.nginx.org/read.php?11,2...439#msg-212439

    which says (my emphasis)

    decided to post my fastcgi_php.conf configuration file that helps me to resolve server environment compatibility issues with older PHP scripts that rely on PATH_INFO, PATH_TRANSLATED, SERVER_URL, SERVER_URI and PHP_SELF variables to be set correctly. Unfortunately, SCRIPT_NAME is not available, as if both SCRIPT_NAME and PHP_SELF are set in the FastCGI environment, PHP_SELF will eventually contain a concatenated string (a bug in PHP (F)CGI mode? - https://bugs.php.net/bug.php?id=55208)
    Now, when I follow that bug tracker, it appears to be neither fixed nor closed, so the bug must still remain.

    My server and config setup seems a little different to his, but eventually I worked out by trial and error that by commenting out
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    in /etc/nginx/fastcgi_params that made Zen cart login work! Hurrah!
    Except, I found it then broke things like phpadmin - I get a 404 not found as soon as I enter username and password. I don't know why, it just does.



    It seems to me that php server configs are set in both the params file - in my case /etc/nginx/fastcgi_params but can also be set "per location". So you remove fastcgi_param SCRIPT_NAME $fastcgi_script_name; from /etc/nginx/fastcgi_params to make Zen Cart work, and ADD it back into (in my case) /etc/nginx/sites-enabled/000-apps.vhost to make phpmyadmin work (phew!). Here's part of my 000-apps.vhost file now...

    PHP Code:
    location /phpmyadmin {
              
    root /usr/share/;
              
    index index.php index.html index.htm;
              
    location ~ ^/phpmyadmin/(.+\.php)$ {
                      
    try_files $uri =404;
                      
    root /usr/share/;
                      include /
    etc/nginx/fastcgi_params# THIS gets picked up first and needs the line fastcgi_param SCRIPT_NAME $fastcgi_script_name; removing
                      
    fastcgi_param SCRIPT_NAME $fastcgi_script_name# THIS is what needs adding
    # .... rest of file etc 
    Then just issue
    service nginx restart

    and you're away and laughing!

    Quote Originally Posted by DrByte View Post
    I seem to recall that Windoze had a bug they had to fix in IIS a couple years back which was doing the same thing.
    Maybe Nginx hasn't caught up yet.
    It seems, in this case, to be more an issue with php-fpm than nginx. Why the bug hasn't been fixed I don't know, but I'll get onto them and add more info.

    Meantime, big thanks for your help! I'll write all this up so it makes more sense in the next day or two, including the equivalent of the protection that .htaccess gives to certain location within Zen.

 

 

Similar Threads

  1. v153 "This webpage has a redirect loop" on new install of 1.5.3
    By vroy in forum Installing on a Linux/Unix Server
    Replies: 9
    Last Post: 10 Aug 2014, 11:24 AM
  2. can not access admin section - redirect loop error
    By mtmunlimited in forum General Questions
    Replies: 6
    Last Post: 11 Apr 2011, 10:32 PM
  3. Admin page goes into redirect loop after installing v 1.3.9h
    By Janie in forum Installing on a Windows Server
    Replies: 14
    Last Post: 27 Nov 2010, 01:47 AM
  4. Admin directory redirect loop, just started last night
    By VincentD in forum General Questions
    Replies: 3
    Last Post: 10 Apr 2010, 05:00 AM
  5. Redirect loop on /admin
    By leeyah in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 29 Dec 2009, 08:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg