breaking the nginx conf for cake
This commit is contained in:
parent
8326524a99
commit
b781c8ec54
@ -1,6 +1,7 @@
|
||||
|
||||
ROOT ?= $(PWD)
|
||||
HTTP_PORT ?= 49438
|
||||
HTTP_HOST ?= localhost
|
||||
PHP_FCGI_PORT ?= 49439
|
||||
|
||||
|
||||
@ -13,14 +14,19 @@ serve-php: php.ini
|
||||
|
||||
|
||||
nginx.conf: nginx.conf.in
|
||||
chmod 644 $@ ;
|
||||
cat $< | \
|
||||
sed -e 's@__ROOT__@$(ROOT)@g' \
|
||||
-e 's@__HTTP_PORT__@$(HTTP_PORT)@g' \
|
||||
-e 's@__PHP_FCGI_PORT__@$(PHP_FCGI_PORT)@g' > $@
|
||||
-e 's@__HTTP_HOST__@$(HTTP_HOST)@g' \
|
||||
-e 's@__PHP_FCGI_PORT__@$(PHP_FCGI_PORT)@g' > $@ ;
|
||||
chmod 444 $@
|
||||
|
||||
|
||||
php.ini: php.ini.in
|
||||
cat $< | sed -e 's@__ROOT__@$(ROOT)@g' > $@
|
||||
chmod 644 $@ ;
|
||||
cat $< | sed -e 's@__ROOT__@$(ROOT)@g' > $@ ;
|
||||
chmod 444 $@
|
||||
|
||||
|
||||
.PHONY: serve
|
||||
|
@ -1,5 +1,6 @@
|
||||
worker_processes 1;
|
||||
error_log __ROOT__/error.log;
|
||||
# error_log error.log;
|
||||
pid __ROOT__/server.pid;
|
||||
daemon off;
|
||||
|
||||
@ -14,41 +15,63 @@ http {
|
||||
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] $status '
|
||||
'"$request" $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
'"$request" $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
autoindex on;
|
||||
|
||||
server {
|
||||
listen __HTTP_PORT__;
|
||||
server_name localhost;
|
||||
access_log access.log main;
|
||||
server_name www.__HTTP_HOST__;
|
||||
rewrite ^(.*) http://__HTTP_HOST__:__HTTP_PORT__$1 permanent;
|
||||
}
|
||||
|
||||
server {
|
||||
listen __HTTP_PORT__;
|
||||
server_name __HTTP_HOST__;
|
||||
access_log __ROOT__/access.log main;
|
||||
# access_log access.log main;
|
||||
|
||||
root __ROOT__/html;
|
||||
|
||||
# location / {
|
||||
# index index.html index.txt index.php;
|
||||
# rewrite (.*) /app/webroot$1 last;
|
||||
# rewrite ^$ /app/webroot last;
|
||||
# }
|
||||
#
|
||||
# location /app/webroot {
|
||||
# index index.html index.txt index.php;
|
||||
# }
|
||||
#
|
||||
# location ~ \.php$ {
|
||||
# include __ROOT__/fastcgi_params;
|
||||
# fastcgi_pass 127.0.0.1:__PHP_FCGI_PORT__;
|
||||
# }
|
||||
|
||||
location / {
|
||||
index index.html index.txt index.php;
|
||||
rewrite (.*) /app/webroot$1 last;
|
||||
rewrite ^$ /app/webroot last;
|
||||
root __ROOT__/html/app/webroot/;
|
||||
index index.php index.html index.htm;
|
||||
if (-f $request_filename) {
|
||||
break;
|
||||
}
|
||||
if (-d $request_filename) {
|
||||
break;
|
||||
}
|
||||
rewrite ^(.+)$ /index.php?q=$1 last;
|
||||
}
|
||||
|
||||
location /app/webroot {
|
||||
index index.html index.txt index.php;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
location ~ .*\.php[345]?$ {
|
||||
include __ROOT__/fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:__PHP_FCGI_PORT__;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME __ROOT__/html/app/webroot$fastcgi_script_name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# <IfModule mod_rewrite.c>
|
||||
# RewriteEngine on
|
||||
# RewriteRule ^$ app/webroot/ [L]
|
||||
# RewriteRule (.*) app/webroot/$1 [L]
|
||||
# </IfModule>
|
||||
|
||||
|
||||
# vim:filetype=nginx
|
Loading…
Reference in New Issue
Block a user