jeebus ... futzing around with nginx again so that absolute path in conf is not necessary
This commit is contained in:
parent
de6a85b421
commit
5f9583bfae
22
docroot/Makefile
Normal file
22
docroot/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
ROOT ?= $(PWD)
|
||||
HTTP_PORT ?= 49448
|
||||
PHP_FCGI_PORT ?= 49449
|
||||
|
||||
|
||||
serve: nginx.conf
|
||||
nginx -p $(ROOT)/ -c $(ROOT)/$<
|
||||
|
||||
|
||||
serve-php:
|
||||
php-cgi -b 127.0.0.1:$(PHP_FCGI_PORT)
|
||||
|
||||
|
||||
nginx.conf: nginx.conf.in
|
||||
cat $< | \
|
||||
sed -e 's@__ROOT__@$(ROOT)@g' \
|
||||
-e 's@__HTTP_PORT__@$(HTTP_PORT)@g' \
|
||||
-e 's@__PHP_FCGI_PORT__@$(PHP_FCGI_PORT)@g' > $@
|
||||
|
||||
|
||||
.PHONY: serve
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
HERE="$(dirname $(readlink -f $0))"
|
||||
exec nginx -p $HERE/ -c $HERE/nginx.conf
|
@ -1,7 +1,6 @@
|
||||
worker_processes 1;
|
||||
error_log error.log;
|
||||
pid server.pid;
|
||||
worker_rlimit_nofile 8192;
|
||||
error_log __ROOT__/error.log;
|
||||
pid __ROOT__/server.pid;
|
||||
daemon off;
|
||||
|
||||
|
||||
@ -11,7 +10,7 @@ events {
|
||||
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
include __ROOT__/mime.types;
|
||||
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] $status '
|
||||
@ -22,10 +21,10 @@ http {
|
||||
autoindex on;
|
||||
|
||||
server {
|
||||
listen 49448;
|
||||
listen __HTTP_PORT__;
|
||||
server_name localhost;
|
||||
access_log access.log main;
|
||||
root /home/me/src/LearningPhp/src/docroot/html;
|
||||
root __ROOT__/html;
|
||||
|
||||
location / {
|
||||
index index.html index.txt index.php;
|
||||
@ -33,7 +32,7 @@ http {
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:49449;
|
||||
fastcgi_pass 127.0.0.1:__PHP_FCGI_PORT__;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
exec php-cgi -b 127.0.0.1:49449
|
Loading…
Reference in New Issue
Block a user