Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS and NGINX
#1
i'm using GetSimple with nginx and it's really fast. I tried to create a good config file, hope someone will improve this. At the moment i'm running 8 low traffic sites on a low end VPS using less than 100 MB ram, including exim4, php, and all modules i loaded. And all perform well even under heavy simulated traffic (loadimpact.com test).

My guess it that GetSimple CMS and Nginx together are the best and fastest thing you can use if you want a lot of speed on a budget server.

Code:
server {
        listen 80;
        server_name mysite.org;
        charset utf-8;
        access_log off;
        root /var/www/mysite.org;
        index index.php;
        
        location / {
            try_files       $uri $uri/ /index.php?id=$uri&$args;
        }

       location ~* /admin/.*\.php$ {
            try_files $uri /admin/index.php?id=$uri&$args;
            include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_pass unix:/var/run/www/php.sock;
       }        
        
        location ~* \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            try_files $uri =404;
            fastcgi_pass unix:/var/run/www/php.sock;
            expires 2h;
        }

        location ~* \.(?:ico|js|gif|jpg|png)$ {
            expires 14d;
        }

        location ~* \.(htm|css|html)$ {
            expires 2d;
        }

# this blocks direct access to the XML files (but sitemap.xml) - that hold all the data
        location ~* \.xml$           { deny all; }
    location ~* \.xml\.bak$     { deny all; }
        location = /sitemap.xml { allow all; }

# this prevents hidden files (beginning with a period) from being served
        location ~ /\.          { deny all; }

        location ^~ /uploads/ {
        if ($request_uri ~* \.php$) {return 403;}
        }
}

a more advanced config is available here: http://get-simple.info/forums/showthread...0#pid24930
(updated jan 2013 - better security and works with GS v.3.2)
Reply


Messages In This Thread
GS and NGINX - by marrco - 2011-01-24, 03:47:03
RE: GS and NGINX - by newtonuy - 2013-02-01, 03:42:38
RE: GS and NGINX - by Carlos - 2013-02-01, 04:05:56
RE: GS and NGINX - by newtonuy - 2013-02-01, 04:14:47
RE: GS and NGINX - by Carlos - 2013-02-01, 04:20:28
RE: GS and NGINX - by newtonuy - 2013-02-01, 04:21:31
RE: GS and NGINX - by asd102 - 2013-03-08, 01:12:06
RE: GS and NGINX - by marrco - 2013-03-08, 21:31:56
RE: GS and NGINX - by asd102 - 2013-03-09, 00:31:07
RE: GS and NGINX - by marrco - 2013-03-09, 00:52:05
RE: GS and NGINX - by asd102 - 2013-03-09, 01:37:31
RE: GS and NGINX - by asd102 - 2013-05-09, 23:26:18
RE: GS and NGINX - by dillingen - 2013-05-29, 21:09:05
RE: GS and NGINX - by jrfiol - 2013-06-22, 05:10:31
RE: GS and NGINX - by marrco - 2013-06-24, 19:04:20
RE: GS and NGINX - by eremini - 2013-09-20, 01:56:34
RE: GS and NGINX - by Everyone - 2013-09-20, 03:33:55
RE: GS and NGINX - by shawn_a - 2013-09-20, 04:02:04
RE: GS and NGINX - by Everyone - 2013-09-20, 18:57:11
RE: GS and NGINX - by marrco - 2014-05-10, 00:52:34
RE: GS and NGINX - by shawn_a - 2014-05-10, 01:38:41
RE: GS and NGINX - by cviebrock - 2014-06-05, 13:53:08
RE: GS and NGINX - by scote - 2014-12-01, 16:44:38
GS and NGINX - by BillF - 2011-01-26, 04:28:39
GS and NGINX - by marrco - 2011-03-08, 04:53:54
GS and NGINX - by [/root.] - 2012-02-07, 05:22:30
RE: GS and NGINX - by plahpoy - 2018-08-25, 09:10:49
GS and NGINX - by marrco - 2012-02-29, 21:26:06
GS and NGINX - by SoftExpert - 2012-03-18, 21:29:53
GS and NGINX - by marrco - 2012-03-19, 19:18:08
GS and NGINX - by incognito - 2012-03-23, 00:36:43
GS and NGINX - by marrco - 2012-05-20, 01:28:36
GS and NGINX - by kaifas - 2012-08-13, 16:34:35



Users browsing this thread: 1 Guest(s)