Created
June 6, 2013 20:14
-
-
Save tatat/5724554 to your computer and use it in GitHub Desktop.
Nginx + Kohana + PHP-FPM (ちゃんと試してない)
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
upstream php54 { | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80; | |
access_log /var/log/nginx/access.log main; | |
error_log /var/log/nginx/error.log warn; | |
index index.html index.htm index.php; | |
set $app_root /usr/share/nginx/kohana; | |
set $doc_root $app_root/application/public; | |
set $kohana_env production; | |
root $doc_root; | |
location = / { | |
rewrite ^(.*)$ /index.php$1 last; | |
} | |
location / { | |
try_files $uri $uri/ /index.php$uri$is_args$args; | |
} | |
location ~ \.php { | |
set $root_path $doc_root; | |
if ($uri ~ ^/index\.php(/.*|)$) { | |
set $root_path $app_root; | |
} | |
fastcgi_split_path_info ^((?U).+\.php)(/.*|)$; | |
fastcgi_pass php54; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name; | |
fastcgi_param PATH_TRANSLATED $root_path$fastcgi_path_info; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param KOHANA_ENV $kohana_env; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment