Welcome to Centmin Mod Community
Register Now

Centminmod nginx - CMS Codeigniter multisite

Discussion in 'Blogs & CMS usage' started by vinaweb, Jun 9, 2017.

  1. vinaweb

    vinaweb New Member

    2
    1
    1
    Jun 6, 2017
    Ratings:
    +1
    Local Time:
    9:14 AM
    I have nginx with mod_rewrite:
    My CMS multi-site build with Codeigniter. Subsite will in /index.php/?__subsite=$1 after rewrite is: /CMS/site-([a-zA-Z0-9])/(.*)$
    It can custom domain by subsite.




    location /CMS/ {
    if (!-e $request_filename){
    rewrite ^/CMS/site-([a-zA-Z0-9])$ /CMS/index.php/?__subsite=$1 break;
    }
    if (!-e $request_filename){
    rewrite ^/CMS/(.
    )$ /CMS/index.php/$1 break;
    }
    if ($http_host ~* "^www.(.+)$"){
    rewrite ^/CMS/(.)$ http://%1$request_uri redirect;
    }
    if ($script_filename ~ "-d"){
    return 403;
    }
    if ($script_filename ~ "-f"){
    return 403;
    }
    }
    location /CMS/site {
    rewrite ^/CMS/site-([a-zA-Z0-9]
    )/(.*)$ /CMS/index.php/$2?__subsite=$1 break;
    }



    I'm trying cover it with syntax param in poster
    https://gist.github.com/centminmod/9034414

    but not running.

    Please help me
    Thanks for view and hope everyone help me nginx multiste.
     
  2. eva2000

    eva2000 Administrator Staff Member

    36,905
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,436
    Local Time:
    12:14 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Never used Wordpress Multi-site nor have I used Codeigniter so can't help much. Does Codeigniter have official nginx rules you can base off of ? Quick search only shows https://codeigniter.com/user_guide/general/environments.html?highlight=nginx

    Have you tried asking for example nginx configs on forum at https://forum.codeigniter.com/ first to work with and transpose to Centmin Mod Nginx vhost ?

    also for posting code best to use CODE tags for easier viewing. How to use forum BBCODE code tags :)
     
    Last edited: Jun 9, 2017
  3. ethanpil

    ethanpil Active Member

    169
    47
    28
    Nov 8, 2015
    Ratings:
    +92
    Local Time:
    12:14 PM
    • Like Like x 1
  4. Jimmy

    Jimmy Premium Member Premium Member

    1,415
    292
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +723
    Local Time:
    9:14 PM
    1.13.x
    MariaDB 10.1.x
..