setup php website with nginx role

This commit is contained in:
2015-09-13 17:44:27 -04:00
parent 50e8b2f41f
commit 8ddae69caf
7 changed files with 107 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
server {
listen {{ server_port }};
server_name {{ server_hostname }};
root {{ server_root }}/public;
access_log /var/log/nginx/{{ server_hostname }}_access.log;
error_log /var/log/nginx/{{ server_hostname }}_error.log;
index index.php index.html
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}