Skip to content

Instantly share code, notes, and snippets.

@adamsdesk
Created April 16, 2015 20:14
Show Gist options
  • Save adamsdesk/5ce9d4893caafe3b5c89 to your computer and use it in GitHub Desktop.
Save adamsdesk/5ce9d4893caafe3b5c89 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name thewarden;
# root directive should be global
root /var/www/sites/thewarden;
index index.php;
autoindex on;
access_log /var/log/nginx/access.thewarden.log;
error_log /var/log/nginx/error.thewarden.log debug;
location /cpanel {
try_files $uri $uri/ /cpanel/webroot/index.php?$args;
location ~ \.php$ {
include snippets/fastcgi-cakephp.conf;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/sites/thewarden/cpanel/webroot/index.php;
fastcgi_param QUERY_STRING url=$request_uri;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# deny access
location ~ /(\.ht|\.git|\.svn) {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment