2014-04-21, 03:25:30
I have it running on production server (Apache 2.4.9) for some time now (having backups ready anytime) without any problems so far.
Here's a generic nginx config for GetSimpleCMS. It contains the enlightened knowledge from posts found on this forum combined with best practices recommended by nginx gurus.
(2014-04-17, 23:56:14)shawn_a Wrote: How about we get a generic nginx config up on github already?What do you mean by that? Would I have to make a commit or something? I can't grasp how github is working, I don't understand it :/ I can post here a generic nginx setup that I've been using for every GS installation and some good willed soul can add it to github (whatever that requires).
Here's a generic nginx config for GetSimpleCMS. It contains the enlightened knowledge from posts found on this forum combined with best practices recommended by nginx gurus.
Code:
server {
server_name **SERVER NAMES (SPACE SEPARATED) GO HERE**;
root **ROOT OF YOUR WEB PAGE**;
access_log **PATH TO ACCESS LOG FILE**;
error_log **PATH TO ERROR LOG FILE**;
index index.php index.html index.htm;
#Specify a charset
charset utf-8;
# Custom 404 page
# error_page 404 /404.html;
# Block direct access to the XML files (except sitemap.xml)
location ~* \.xml$ {
deny all;
}
location ~* \.xml\.bak$ {
deny all;
}
location = /sitemap.xml {
allow all;
}
# Block direct access to hidden files
location ~ /\. {
deny all;
}
# Prevent execution of php from uploads folder
location ~* /uploads/.+\.php$ {
deny all;
}
# Generic location. Rewrite works with and without pretty urls.
location / {
rewrite /?([A-Za-z0-9_-]+)/?$ /index.php?id=$1&$2 last;
}
# Handle special "admin" url.
location /admin {
try_files $uri $uri/ /admin/index.php?id=$uri&$args;
}
# Handle php files.
location ~* \.php$ {
# Prevent running php code from purposefully malformed urls.
# Comment out the line below if your fastcgi handler doesn't reside on the same server
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi.conf;
}
}