Commit 60164f99 authored by Marco Mariani's avatar Marco Mariani

abilian: [WIP] added nginx instance

parent f6cba2aa
[buildout]
parts =
nginx
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[nginx-configuration]
recipe = slapos.recipe.template:jinja2
template = ${nginx.conf.in:location}/nginx.conf.in
rendered = $${directories:nginx-configuration}/nginx.conf
context =
raw pid_file $${directories:run}/nginx.pid
raw error_log $${directories:log}/nginx.log
raw server_name test
raw ssl_certificate $${directories:home}/server.crt
raw ssl_certificate_key $${directories:home}/server.key
raw access_log $${directories:log}/test-ssl-access.log
raw ipv6 $${instance-parameters:ipv6-random}
#configuration-template-path = ${nginx.conf.in:location}/nginx.conf.in
#
#vhost-configuration-directory-location = $${directories:nginx-vhost-configuration}
#nginx-prefix = ${nginx-enable-sub:location}
#nginx-temp-path = $${directories:nginx-temp-path}
#home-directory = $${directories:home}
[nginx]
recipe = slapos.cookbook:wrapper
nginx-executable = $${:nginx-prefix}/sbin/nginx
nginx-prefix = ${nginx-enable-sub:location}
command-line = $${:nginx-executable} -c $${nginx-configuration:rendered} -p $${directories:home}
wrapper-path = $${directories:services}/nginx
...@@ -6,6 +6,7 @@ offline = true ...@@ -6,6 +6,7 @@ offline = true
extends = extends =
${instance-postgres:output} ${instance-postgres:output}
${instance-nginx:output}
${instance-extranet:output} ${instance-extranet:output}
${instance-redis:output} ${instance-redis:output}
${instance-environment:output} ${instance-environment:output}
...@@ -27,6 +28,7 @@ parts = ...@@ -27,6 +28,7 @@ parts =
cron cron
postgres-backup postgres-backup
cron-postgres-backup cron-postgres-backup
nginx
...@@ -67,24 +69,30 @@ mode = 0644 ...@@ -67,24 +69,30 @@ mode = 0644
[directories] [directories]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin home = $${buildout:directory}
etc = $${buildout:directory}/etc bin = $${:home}/bin
etc = $${:home}/etc
cron-entries = $${:etc}/cron.d cron-entries = $${:etc}/cron.d
crontabs = $${:etc}/crontabs crontabs = $${:etc}/crontabs
cronstamps = $${:etc}/cronstamps cronstamps = $${:etc}/cronstamps
run = $${:var}/run run = $${:var}/run
scripts = $${:etc}/run scripts = $${:etc}/run
srv = $${buildout:directory}/srv srv = $${:home}/srv
services = $${:etc}/service services = $${:etc}/service
promises = $${:etc}/promise promises = $${:etc}/promise
var = $${buildout:directory}/var var = $${:home}/var
backup = $${:var}/backup backup = $${:var}/backup
extranet_spr-instance = $${:var}/extranet_spr-instance extranet_spr-instance = $${:var}/extranet_spr-instance
cache = $${:extranet_spr-instance}/cache cache = $${:extranet_spr-instance}/cache
data = $${:extranet_spr-instance}/data data = $${:extranet_spr-instance}/data
log = $${:var}/log log = $${:home}/logs
tmp = $${:var}/tmp tmp = $${:var}/tmp
whoosh = $${:data}/whoosh whoosh = $${:data}/whoosh
nginx-configuration = $${:etc}/nginx
nginx-vhost-configuration = $${:nginx-configuration}/vhost
nginx-cache = $${:var}/cache
nginx-temp-path = $${:srv}/nginx-proxy
[cron-simplelogger] [cron-simplelogger]
......
...@@ -19,6 +19,9 @@ extends = ...@@ -19,6 +19,9 @@ extends =
../../../component/fontconfig/buildout.cfg ../../../component/fontconfig/buildout.cfg
../../../component/libreoffice-bin/buildout.cfg ../../../component/libreoffice-bin/buildout.cfg
../../../component/nginx/buildout.cfg
parts = parts =
slapos-cookbook slapos-cookbook
...@@ -59,9 +62,12 @@ parts = ...@@ -59,9 +62,12 @@ parts =
Extranet_SPR Extranet_SPR
nginx nginx
instance
instance-postgres instance-postgres
instance-redis instance-redis
instance-nginx
instance-environment
instance-extranet
instance
config-staging-py-template config-staging-py-template
config-production-py-template config-production-py-template
abilian-config abilian-config
...@@ -156,7 +162,7 @@ egg-link = Abilian-Core.egg-link ...@@ -156,7 +162,7 @@ egg-link = Abilian-Core.egg-link
[slapos-cookbook-repository] [slapos-cookbook-repository]
< = git-repository < = git-repository
repository = http://git.erp5.org/repos/slapos.git repository = http://git.erp5.org/repos/slapos.git
branch = systematic branch = systematic-nginx
[slapos-cookbook-repository-check] [slapos-cookbook-repository-check]
< = git-repository-check < = git-repository-check
...@@ -222,6 +228,17 @@ configure-command = ...@@ -222,6 +228,17 @@ configure-command =
-Dusethreads -Dusethreads
[nginx.conf.in]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
md5sum = 9f34ccfa2a7b1ebdf656e99d8624047f
download-only = true
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
#---------------- #----------------
#-- Instance-level buildout profiles. #-- Instance-level buildout profiles.
...@@ -229,7 +246,7 @@ configure-command = ...@@ -229,7 +246,7 @@ configure-command =
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg output = ${buildout:directory}/instance.cfg
md5sum = 3b6105aa9335141c2d73871bdde80e9d md5sum = 7f35cb12406544a678f81763f3f0e0ba
mode = 0644 mode = 0644
[instance-postgres] [instance-postgres]
...@@ -246,6 +263,13 @@ output = ${buildout:directory}/instance-redis.cfg ...@@ -246,6 +263,13 @@ output = ${buildout:directory}/instance-redis.cfg
md5sum = a322af67bcfd73f1782494c147499071 md5sum = a322af67bcfd73f1782494c147499071
mode = 0644 mode = 0644
[instance-nginx]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-nginx.cfg.in
output = ${buildout:directory}/instance-nginx.cfg
md5sum = 1c975a08096aa3eb52e460efbb660e5c
mode = 0644
[instance-extranet] [instance-extranet]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-extranet.cfg.in url = ${:_profile_base_location_}/instance-extranet.cfg.in
......
daemon off;
worker_processes 2;
error_log {{ error_log }} info;
pid {{ pid_file }};
events {
worker_connections 1024;
}
http {
server {
listen listen {{ ipv6 }}:443 ssl;
server_name {{ server_name }};
ssl on;
ssl_certificate {{ ssl_certificate }};
ssl_certificate_key {{ ssl_certificate_key }};
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log {{ access_log }};
# location /static/ {
# alias %(static_dir)s/;
# }
#
# location /errors/ {
# alias %(root)s/html_maintenance/;
# }
#
# location / {
# proxy_pass http://localhost:%(port)d/;
# include /etc/nginx/proxy_params;
# client_max_body_size 50M;
# error_page 502 503 /errors/nginx_no_service_page.html;
# }
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment