dip

old school recipes for janitorial snafu.
git clone git://git.ricketyspace.net/dip.git
Log | Files | Refs

commit 2352aeb8f701f10c372e96d61647a2397fd1543b
parent 5d9d0158e36b5b3e453a1d074907742447f7682a
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue,  1 Jan 2019 20:28:56 -0500

Add etc/nginx.

* Makefile: Add nginx.
* etc/nginx/nginx.conf.patch: New file.
* etc/nginx/sites.conf: New file.

Diffstat:
Makefile | 14++++++++++++++
etc/nginx/nginx.conf.patch | 10++++++++++
etc/nginx/sites.conf | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -19,6 +19,20 @@ hosts: .PHONY: hosts +# Provision /etc/nginx +NGINX_DIR:=etc/nginx +HTML_DIR:=/var/www/html/ +nginx: + rsync -a ${NGINX_DIR}/sites.conf /${NGINX_DIR}/sites.conf + grep -q 'sites.conf' /${NGINX_DIR}/nginx.conf || \ + patch -u /${NGINX_DIR}/nginx.conf ${NGINX_DIR}/nginx.conf.patch + + mkdir -p ${HTML_DIR}/sicp + mkdir -p ${HTML_DIR}/cached-web + mkdir -p ${HTML_DIR}/taoup + mkdir -p ${HTML_DIR}/vm +.PHONY: nginx + # Provision exports exports: rsync -a etc/exports /etc/exports diff --git a/etc/nginx/nginx.conf.patch b/etc/nginx/nginx.conf.patch @@ -0,0 +1,10 @@ +diff --git a/nginx/nginx.conf b/nginx/nginx.conf +index 156f859..fbcd811 100644 +--- a/nginx/nginx.conf ++++ b/nginx/nginx.conf +@@ -120,4 +120,5 @@ http { + # ssl_prefer_server_ciphers on; + #} + ++ include /etc/nginx/sites.conf; + } diff --git a/etc/nginx/sites.conf b/etc/nginx/sites.conf @@ -0,0 +1,57 @@ +### sicp server +server { + server_name sicp.web; + root /var/www/html/sicp; + index index.html; + + location / { + autoindex on; + } +} + +### cached web +server { + ssi on; + server_name cached.web; + root /var/www/html/cached-web; + index index.html; + + location / { + autoindex on; + } +} + +### taoup server +server { + ssi on; + server_name taoup.web; + root /var/www/html/taoup; + index index.html; + + location / { + autoindex on; + } +} + +# vm server. +server { + ssi on; + server_name vm.web; + root /var/www/html/vm; + index index.php index.html; + + location / { + autoindex on; + include /etc/nginx/mime.types; + rewrite ^/(land|macro|wp|wild|people|fashion).*$ /gallery/$1/ permanent; + rewrite ^/as/photography-classes/?$ /as permanent; + } + + location ~ \\.php$ { + try_files $uri $uri/ =404; + fastcgi_pass unix:run/php72-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } +}