Last active
December 17, 2015 13:59
-
-
Save jessetane/5620782 to your computer and use it in GitHub Desktop.
nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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