From dbfa86bdd2ee6c2e602b813abf6e0e5dc1821d76 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Thu, 2 Apr 2015 17:14:34 +0200 Subject: [PATCH] =?utf8?q?Ajout=C2=A0:=20etc/nginx/org/heureux-cyclage/bur?= =?utf8?q?ettes?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nginx/org/heureux-cyclage/burettes/... | 1 + .../org/heureux-cyclage/burettes/common.conf | 91 ++++++++++++++ .../org/heureux-cyclage/burettes/install | 46 +++++++ .../org/heureux-cyclage/burettes/server.conf | 116 ++++++++++++++++++ .../nginx/org/heureux-cyclage/burettes/... | 1 + .../nginx/org/heureux-cyclage/burettes/user | 1 + 6 files changed, 256 insertions(+) create mode 120000 srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/... create mode 100644 srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/common.conf create mode 100755 srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/install create mode 100644 srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/server.conf create mode 120000 srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/... create mode 100644 srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/user diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/... b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/... new file mode 120000 index 0000000..951b30d --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/... @@ -0,0 +1 @@ +../... \ No newline at end of file diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/common.conf b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/common.conf new file mode 100644 index 0000000..8483a6c --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/common.conf @@ -0,0 +1,91 @@ +server_name + burettes.heureux-cyclage.org + burette.atelier-etincelle.org + burette.atelier-etincelle.heureux-cyclage.org + burette.atelierdynamo.fr + burette.autourducycle.heureux-cyclage.org + burette.bretzselle.heureux-cyclage.org + burette.bretzselle.org + burette.changedechaine.heureux-cyclage.org + burette.cyclesetmanivelles.heureux-cyclage.org + burette.cyclocoop.heureux-cyclage.org + burette.cyclocoop.org + burette.cyclofficineangouleme.heureux-cyclage.org + burette.dynamo.heureux-cyclage.org + burette.etudesetchantiersidf.heureux-cyclage.org + burette.eturecup.heureux-cyclage.org + burette.eturecup.org + burette.labecaneajules.fr + burette.labecaneajules.heureux-cyclage.org + burette.lapetiterennes.heureux-cyclage.org + burette.lapetiterennes.org + burette.laptiterustine.heureux-cyclage.org + burette.larouelibre.heureux-cyclage.org + burette.la-roue-libre.com + burette.lechatperche.heureux-cyclage.org + burette.mig.heureux-cyclage.org + burette.mobilidees.heureux-cyclage.org + burette.mobilidees.org + burette.ohcyclo.heureux-cyclage.org + burette.ptitvelo.heureux-cyclage.org + burette.ptitvelo.net + burette.recupr.heureux-cyclage.org + burette.recupr.org + burette.repeyre.fr + burette.repeyre.heureux-cyclage.org + burette.rouepet.heureux-cyclage.org + burette.rouepet.org + burette.txirrindola.heureux-cyclage.org + burette.txirrindola.org + burette.velocampus.net + burette.velocampus_nantes.heureux-cyclage.org + burette.velorution.org + burette.velorution_idf.heureux-cyclage.org + burette.velorutiontoulouse.heureux-cyclage.org + burette.velosenville.org + burette.vieuxbiclou.heureux-cyclage.org + burette.vieuxbiclou.org; + +client_body_buffer_size 1024k; +client_max_body_size 10m; + +proxy_buffers 16 64k; +proxy_buffer_size 128k; + +location ~ /\. { + access_log off; + deny all; + log_not_found off; + } +location / { + proxy_next_upstream error timeout + invalid_header + http_500 + http_502 + http_503; + # NOTE: force timeouts if the backend dies. + proxy_pass http://openerp7_burette; + proxy_redirect off; + # NOTE: by default, do not forward anything + proxy_read_timeout 500; + proxy_set_header Host $host; + proxy_set_header OpenERP-DB-Filter $burette_dbfilter; + # TODO: utiliser un certificat utilisateurice X.509 + # pour initialiser cette variable. + proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + # NOTE: let the OpenERP web service know that we're using HTTPS, + # otherwise it will generate URL using http:// and not https:// + proxy_set_header X-Real-IP $remote_addr; + } + +location ~* ^/web/static/ { + # NOTE: cache some static data in memory for 60mins; + # under heavy load this should relieve stress on the OpenERP web interface a bit. + expires 864000; + proxy_buffering on; + proxy_cache_valid 200 60m; + proxy_pass http://openerp7_burette; + } + +# vim: ft=sh diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/install b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/install new file mode 100755 index 0000000..5ad51de --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/install @@ -0,0 +1,46 @@ +#!/bin/sh -eu +# SYNTAX: $site +# DESCRIPTION: install nginx(1) site $site + +# ACTION: initialize from ./ + test -L "$0" && tool="$(readlink -e "$0")" || tool=$0 + tool=$(readlink -e "${tool%/*}"/...) + . "$tool"/lib/install.sh +# ACTION: initialize $sv from ./etc/$sv/ + sv=${cmd##*/etc/} + sv=${sv%%/*} +# ACTION: initialize $sv from ./sys/$sv/ + nginx_home=$("$tool"/cat sys/"$sv"/home) + nginx_user=$("$tool"/cat sys/"$sv"/user) +# ACTION: initialize $site from ./etc/$sv/$site/install + site=${cmd##*/"$sv"/} + site=${site%/install} + site=${1:-$site} +# ACTION: install from ./etc/$sv/$site/ + www_user=$("$tool"/cat sys/"$sv"/"$site"/user) || + www_user=$(printf %s www-"$site" | tr -c '[:alnum:]' -) + www_home=$("$tool"/cat sys/"$sv"/"$site"/home) || + www_home="$nginx_home"/"$site" + nginx_log_home=$("$tool"/cat sys/"$sv"/log/home) + nginx_log_user=$("$tool"/cat sys/"$sv"/log/user) + "$tool"/etc/user/adduser "$www_user" \ + --disabled-login \ + --disabled-password \ + --group \ + --home "$www_home" \ + --shell /bin/false \ + --system + "$tool"/ssh-sudo \ + install -D -d -m 2750 -o "$www_user" -g "$www_user" \ + "$www_home" + "$tool"/ssh-sudo \ + adduser "$nginx_user" "$www_user" + "$tool"/ssh-sudo \ + install -D -d -m 2750 -o "$nginx_log_user" -g "$nginx_log_user" \ + "$nginx_log_home"/"$site" + "$tool"/ssh-sudo \ + install -D -d -m 750 -o root -g root \ + /etc/"$sv"/"$site" + etckeeper_exit + etckeeper_exit () { true; } + "$tool"/install etc/"$sv"/"$site" diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/server.conf b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/server.conf new file mode 100644 index 0000000..2094c7f --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/burettes/server.conf @@ -0,0 +1,116 @@ +server { + listen 80; + server_name + burettes.heureux-cyclage.org + burette.atelier-etincelle.heureux-cyclage.org + burette.atelier-etincelle.org + burette.atelierdynamo.fr + burette.autourducycle.heureux-cyclage.org + burette.bretzselle.heureux-cyclage.org + burette.bretzselle.org + burette.changedechaine.heureux-cyclage.org + burette.cyclesetmanivelles.heureux-cyclage.org + burette.cyclocoop.heureux-cyclage.org + burette.cyclocoop.org + burette.cyclofficineangouleme.heureux-cyclage.org + burette.dynamo.heureux-cyclage.org + burette.etudesetchantiersidf.heureux-cyclage.org + burette.eturecup.heureux-cyclage.org + burette.eturecup.org + burette.labecaneajules.fr + burette.labecaneajules.heureux-cyclage.org + burette.lapetiterennes.heureux-cyclage.org + burette.lapetiterennes.org + burette.laptiterustine.heureux-cyclage.org + burette.larouelibre.heureux-cyclage.org + burette.la-roue-libre.com + burette.lechatperche.heureux-cyclage.org + burette.mig.heureux-cyclage.org + burette.mobilidees.heureux-cyclage.org + burette.mobilidees.org + burette.ohcyclo.heureux-cyclage.org + burette.ptitvelo.heureux-cyclage.org + burette.ptitvelo.net + burette.recupr.heureux-cyclage.org + burette.recupr.org + burette.repeyre.fr + burette.repeyre.heureux-cyclage.org + burette.rouepet.heureux-cyclage.org + burette.rouepet.org + burette.txirrindola.heureux-cyclage.org + burette.txirrindola.org + burette.velocampus.net + burette.velocampus_nantes.heureux-cyclage.org + burette.velorution.org + burette.velorution_idf.heureux-cyclage.org + burette.velorution_toulouse.heureux-cyclage.org + burette.velosenville.org + burette.vieuxbiclou.heureux-cyclage.org + burette.vieuxbiclou.org; + + return 301 https://$host$request_uri; + } +server { + listen 443; + include /etc/nginx/org/heureux-cyclage/burettes/common.conf; + include /etc/nginx/conf.d/ssl-pfs.conf; + ssl_certificate /etc/nginx/org/heureux-cyclage/crt.pem; + ssl_certificate_key /etc/nginx/org/heureux-cyclage/key.pem; +} +upstream openerp7_burette { + server 127.0.0.1:8069 + fail_timeout=300s + weight=1; + } +map $http_host $burette_dbfilter { + default ""; + burette.atelier-etincelle.heureux-cyclage.org "atelieretincelle$"; + burette.atelier-etincelle.org "atelieretincelle$"; + burette.atelierdynamo.fr "dynamo$"; + burette.autourducycle.heureux-cyclage.org "autourducycle$"; + burette.bicyclaide.heureux-cyclage.org "bicyclaide$"; + burette.bicyclaide.org "bicyclaide$"; + burette.bretzselle.heureux-cyclage.org "bretzselle$"; + burette.bretzselle.org "bretzselle$"; + burette.changedechaine.heureux-cyclage.org "changedechaine$"; + burette.cyclesetmanivelles.heureux-cyclage.org "cyclesetmanivelles$"; + burette.cyclocoop.heureux-cyclage.org "cyclo_.*$"; + burette.cyclocoop.org "cyclo_.*$"; + burette.cyclofficineangouleme.heureux-cyclage.org "cyclofficine_angouleme$"; + burette.dynamo.heureux-cyclage.org "dynamo$"; + burette.etudesetchantiersidf.heureux-cyclage.org "etudesetchantiersidf$"; + burette.eturecup.heureux-cyclage.org "eturecup$"; + burette.eturecup.org "eturecup$"; + burette.labecaneajules.fr "labecaneajules$"; + burette.labecaneajules.heureux-cyclage.org "labecaneajules$"; + burette.lapetiterennes.heureux-cyclage.org "lapetiterennes$"; + burette.lapetiterennes.org "lapetiterennes$"; + burette.laptiterustine.heureux-cyclage.org "laptiterustine$"; + burette.larouelibre.heureux-cyclage.org "larouelibre$"; + burette.la-roue-libre.com "larouelibre$"; + burette.lechatperche.heureux-cyclage.org "lechatperche$"; + burette.mig.heureux-cyclage.org "heureuxcyclage$"; + burette.mobilidees.heureux-cyclage.org "mobilidees$"; + burette.mobilidees.org "mobilidees$"; + burette.ohcyclo.heureux-cyclage.org "ohcyclo$"; + burette.ptitvelo.heureux-cyclage.org "ptitvelo$"; + burette.ptitvelo.net "ptitvelo$"; + burette.recupr.heureux-cyclage.org "recupr$"; + burette.recupr.org "recupr$"; + burette.repeyre.fr "repeyre$"; + burette.repeyre.heureux-cyclage.org "repeyre$"; + burette.rouepet.heureux-cyclage.org "rouepet$"; + burette.rouepet.org "rouepet$"; + burette.txirrindola.heureux-cyclage.org "txirrindola$"; + burette.txirrindola.org "txirrindola$"; + burette.velocampus.net "velocampus_nantes$"; + burette.velocampus_nantes.heureux-cyclage.org "velocampus_nantes$"; + burette.velorution.org "velorution_idf$"; + burette.velorution_idf.heureux-cyclage.org "velorution_idf$"; + burette.velorution_toulouse.heureux-cyclage.org "velorution_toulouse$"; + burette.velosenville.heureux-cyclage.org "velosenville$"; + burette.velosenville.org "velosenville$"; + burette.vieuxbiclou.heureux-cyclage.org "vieuxbiclou$"; + burette.vieuxbiclou.org "vieuxbiclou$"; + burettes.heureux-cyclage.org ".*$"; + } diff --git a/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/... b/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/... new file mode 120000 index 0000000..951b30d --- /dev/null +++ b/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/... @@ -0,0 +1 @@ +../... \ No newline at end of file diff --git a/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/user b/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/user new file mode 100644 index 0000000..386697f --- /dev/null +++ b/srv/ateliers/sys/nginx/org/heureux-cyclage/burettes/user @@ -0,0 +1 @@ +www-burettes \ No newline at end of file -- 2.20.1