Welcome to Centmin Mod Community
Register Now

Amember nginx rewrite rules not working at Centminmod because of @php rule

Discussion in 'Other Web Apps usage' started by pamamolf, Jan 21, 2019.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,585
    345
    83
    May 31, 2014
    Ratings:
    +667
    Local Time:
    12:47 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Hello

    I am trying to make the Amember Pro script to work on Centminmod...

    It requires to set at the config the:

    Code:
           location ~* ^/amember/.*\.(js|ico|gif|jpg|png|css|swf|csv)$ {}
           location ~* ^/amember/setup/index.php$ { try_files not-existing-file @php; }
           location ~* ^/amember/js.php { try_files not-exiting-file @php; }
           location ~* ^/amember/index.php$ { try_files not-existing-file @php; }
           location ~* ^/amember/public.php$ { try_files not-existing-file @php; }
    
           location ~* ^/amember/public { rewrite ^.*$ /amember/public.php; }
           location ~* ^/amember/setup { rewrite ^.*$ /amember/setup/index.php; }
           location ~* ^/amember { rewrite ^.*$ /amember/index.php; }
    
           location ~ \.php$ {
                   try_files not-existing-file @php;
           }
    
           location @php {
    
                   fastcgi_pass  127.0.0.1:9000;
                   include        /etc/nginx/fastcgi_params;
                   fastcgi_param  SCRIPT_FILENAME  /var/www/nginx-default/$fastcgi_script_name;
    
           }
    another user report that this also works:

    Code:
    location ~ \.php$ {
       try_files not-existing-file @php;
    }
    
    location @php {
      fastcgi_pass 127.0.0.1:9000;
      include fastcgi_params;
    }
    But both @php locations doesn't work....

    I think Centminmod includes the related settings and there is a conflict....

    Can you please help me on that?

    Last step before my friend join Centminmod :)

    Thank you
     
    Last edited: Jan 21, 2019
  2. pamamolf

    pamamolf Premium Member Premium Member

    3,585
    345
    83
    May 31, 2014
    Ratings:
    +667
    Local Time:
    12:47 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    I just fix that by adding the php rules on top of the Amember rules :)
     
    • Informative Informative x 1