Welcome to Centmin Mod Community
Register Now

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:
    9:35 AM
    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

    30,934
    6,911
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,407
    Local Time:
    12:35 PM
    Nginx 1.13.x
    MariaDB 5.5
    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;
    }
    
     
    • Like Like x 1
  3. giahancute2013

    giahancute2013 New Member

    10
    1
    3
    Oct 27, 2016
    Ratings:
    +1
    Local Time:
    9:35 AM
    1.1.4
    Maria DB 10
    Thanks Ad