Search code examples
phpapachenginxservercontent-management-system

Subrion CMS Nginx Installation Issue


I would like to try out Subrion CMS however, I've had issues getting this to work.

Is Apache mod-rewrite required? Will this require the use of Apache? Can Nginx only be used as a reverse proxy with Subrion?

Debian 8 - Nginx - MariaDB - PHP5-FPM - Subrion CMS

Installation screen says everything looks good. Permissions and ownership and non-issue. I think this is a Nginx rewrite issue as I notice the url will become "/install/install/" upon submission however, the page remains the same as if you were to scroll to top. In the meantime I am going without a CMS so there is no pressing rush on this.

If you are running Subrion CMS with Nginx I would appreciate your take on this situation. Thanks for reading.


Solution

  • Yes, Subrion CMS can be run on Nginx server. Here is the configuration that will work for nginx:

    server {
        listen      80; # make sure there is no conflict with apache server listening on port 80
        server_name subrion_domain.com; # your website domain name
    
        root        /var/www/subrion; # absolute path to your subrion core files
        index       index.php;
    
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }
    
        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
    
        location / {
            try_files $uri $uri/ /index.php?q=$uri&$args;
        }
    
        error_page  404  /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }
    
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    
        location /install/ {
            rewrite ^/install/(.*)$ /install/index.php?_p=$1;
        }
    
        # deny access to apache .htaccess files
        location ~ /\.ht
        {
            deny all;
        }
    
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
            }
    }
    

    Anyhow, please note you might have issue with admin dashboard. You will need to update admin URL, change the default "admin" dashboard URL to any value, and clear tmp/ folder. This will work fine.

    Let me know if you need any assistance. I will be happy to help.