Discover Centmin Mod today
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:
    1:55 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

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    4:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    4:55 AM
    • Like Like x 1