Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nginx, GetSimple CMS and preety urls, too.
#1
Did anybody install this on nginx?
Reply
#2
I haven’t tried installing it on nginx, and frankly I find it a bit hard to find a lot of information on that server system.

GetSimple needs PHP5 with the SimpleXML lib to run, if you can get that to run on nginx I don’t see a reason why it wouldn’t run.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
I am working on deploying it right now, I've got wordpress working, previously, but for now I can't get it to work, digging into it Smile

I hope I will have enough strengths to write short tutorial on the subject here, once I am done.
Reply
#4
Okay, here is the conf I've used (it's based on that for wordpress, so in case you want to deploy simplecms on nginx, google for deploying worpdress, try it, see that it works (or just find the php part, since we don't need mysql for simplecms).

vim /etc/nginx/sites-available/test.com
Code:
server {
    listen   80;
    #TODO: make www to redirect!
    server_name test.com;
    access_log /var/log/nginx/test.com.access.log;
    error_log /var/log/nginx/test.com.error.log;

    location / {
        root   /var/www/test.com;
        index  index.html index.htm index.php;

        # this serves static files that exist without running other rewrite tests
        if (-f $request_filename) {
            expires 30d;
            break;
        }

        # this sends all non-existing file or directory requests to index.php
        if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?id=$1 last;
        }
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www/test.com$fastcgi_script_name;
    }
}
So, everything I needed to change (everything that is different from wordpress) is that rewrite rule:
instead of
Code:
rewrite ^(.+)$ /index.php?q=$1 last;

we do
Code:
rewrite ^(.+)$ /index.php?id=$1 last;
(substituted q with id)

Help this will help to somebody Smile

PS I am deploying PHP with php-fpm, google "nginx php-fpm"
Reply
#5
Thanks. You saved me a lot of time.
Reply
#6
[/root.] Wrote:Thanks. You saved me a lot of time.

don't do the rewrite, that's not efficient. And use try_files. I gave a few examples of nginx config in a different thread. When i have time i'll post a better config for newer nginx versions (1+)
Reply




Users browsing this thread: 1 Guest(s)