Skip to content

Instantly share code, notes, and snippets.

@jessetane
Last active December 17, 2015 13:59
Show Gist options
  • Save jessetane/5620782 to your computer and use it in GitHub Desktop.
Save jessetane/5620782 to your computer and use it in GitHub Desktop.
nginx.conf
server {
listen 8082;
return 404;
}
server {
server_name nginx.website.com;
listen 8082;
root /home/ubuntu/website.com/builds/nginx/www;
index index.php index.html;
# statics
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# allow phpmyadmin access via this domain
#include /etc/phpmyadmin/nginx.conf;
# thumbs
rewrite ^/thumbs/(.*)x(.*)/(.*)/r/(.*) /thumbs/resize.php?src=/$4&h=$2&w=$1&a=$3;
location ~ ^/thumbs/resize.php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# pass off any other php
location ~ .*\.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment