-
-
Save erickhaendel/94129ef93e1be7483ba392acd8e9d64a to your computer and use it in GitHub Desktop.
Nginx virtual host site configuration file for CakePHP3.x
This file contains hidden or 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
# | |
# Cakebox-generated Nginx virtual host using generic template. | |
# | |
server { | |
listen 80; | |
server_name www.cake3.app; | |
rewrite ^(.*) http://cake3.app$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name cake3.app; | |
# root directive should be global | |
root /home/vagrant/Apps/cake3.app/webroot; | |
index index.php; | |
access_log /var/log/nginx/cake3.app.access.log; | |
error_log /var/log/nginx/cake3.app.error.log; | |
location / { | |
try_files $uri \$uri /index.php?$args; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
# deny access to hidden | |
location ~ /\. { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment