Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx Rule..

Discussion in 'Other Web Apps usage' started by giahancute2013, Dec 12, 2016.

  1. giahancute2013

    giahancute2013 New Member

    10
    1
    3
    Oct 27, 2016
    Ratings:
    +1
    Local Time:
    8:20 PM
    1.1.4
    Maria DB 10
    Code:
    RewriteEngine on
    RewriteBase /images/
    RewriteRule ^images_(.*)_(.*).jpg index.php?nu=$1&img=$2
    RewriteRule ^(.*).jpg index.php?nu=0&img=$1
    How can i convert .htaccess to nginx rule.


    Thank you

    Regards,
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    11:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    not always accurate but Rule convertor, convert apache htaccess rewrite rules to nginx rewrite rules automatically might be a starter

    Code (Text):
    rewrite ^/images_(.*)_(.*).jpg /index.php?nu=$1&img=$2;
    rewrite ^/(.*).jpg /index.php?nu=0&img=$1;

    Though with rewritebase of /images/ maybe
    Code (Text):
    location ~ /images/ {
    rewrite ^/images/images_(.*)_(.*).jpg /index.php?nu=$1&img=$2;
    rewrite ^/images/(.*).jpg /index.php?nu=0&img=$1;
    }
    
     
  3. giahancute2013

    giahancute2013 New Member

    10
    1
    3
    Oct 27, 2016
    Ratings:
    +1
    Local Time:
    8:20 PM
    1.1.4
    Maria DB 10
    Thanks Ad