Last active
August 29, 2015 14:10
-
-
Save alexglue/085ef02f7c4b3e152265 to your computer and use it in GitHub Desktop.
Phalcon nginx+php-fpm minimal configuration
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
upstream phalcon-php-fpm { | |
server unix:/var/run/php5-fpm.sock; | |
#server 127.0.0.1:9001; | |
} | |
server { | |
listen 80; | |
server_name sitename.loc; #do not forget to add "127.0.0.1 sitename.loc" string to your /etc/hosts | |
set $root_path '/home/user/proj/phalcon/sitename/public'; | |
root $root_path; | |
access_log /var/log/nginx/sitename-access.log; | |
error_log /var/log/nginx/sitename-error.log error; | |
index index.php index.html index.htm; | |
try_files $uri $uri/ @rewrite; | |
location @rewrite { | |
rewrite ^/(.*)$ /index.php?_url=/$1; | |
} | |
location ~ \.php { | |
# try_files $uri =404; | |
fastcgi_index /index.php; | |
fastcgi_pass phalcon-php-fpm; | |
include fastcgi_params; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { | |
root $root_path; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment