Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos
Commits
7b4d9ecc
Commit
7b4d9ecc
authored
Apr 12, 2012
by
Thomas Lechauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
html5as recipe created for nginx instance
parent
657544b3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
149 additions
and
3 deletions
+149
-3
component/nginx/buildout.cfg
component/nginx/buildout.cfg
+4
-2
slapos/recipe/html5as/__init__.py
slapos/recipe/html5as/__init__.py
+68
-0
slapos/recipe/html5as/templates/nginx_conf.in
slapos/recipe/html5as/templates/nginx_conf.in
+51
-0
slapos/recipe/html5as/templates/nginx_index.in
slapos/recipe/html5as/templates/nginx_index.in
+21
-0
slapos/recipe/html5as/templates/nginx_run.in
slapos/recipe/html5as/templates/nginx_run.in
+5
-0
software/html5as/software.cfg
software/html5as/software.cfg
+0
-1
No files found.
component/nginx/buildout.cfg
View file @
7b4d9ecc
[buildout]
[buildout]
extends =
extends =
../pcre/buildout.cfg
../pcre/buildout.cfg
../zlib/buildout.cfg
parts = nginx
parts = nginx
...
@@ -8,5 +9,6 @@ parts = nginx
...
@@ -8,5 +9,6 @@ parts = nginx
recipe = hexagonit.recipe.cmmi
recipe = hexagonit.recipe.cmmi
url = http://nginx.org/download/nginx-1.0.14.tar.gz
url = http://nginx.org/download/nginx-1.0.14.tar.gz
configure-options=
configure-options=
--with-ld-opt="-L ${pcre:location}/lib"
--with-ld-opt="-L ${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib"
--with-cc-opt="-I ${pcre:location}/include"
--with-cc-opt="-I ${pcre:location}/include"
\ No newline at end of file
slapos/recipe/html5as/__init__.py
0 → 100644
View file @
7b4d9ecc
##############################################################################
#
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
import
binascii
import
os
import
sys
class
Recipe
(
GenericBaseRecipe
):
"""
nginx instance configuration.
"""
def
install
(
self
):
config
=
dict
(
nb_workers
=
self
.
options
[
"nb_workers"
]
path_pid
=
self
.
options
[
"path_pid"
]
path_log
=
self
.
options
[
"path_log"
]
path_access_log
=
self
.
options
[
"path_access_log"
]
root
=
self
.
options
[
"root"
]
ip
=
self
.
options
[
"ip"
]
port
=
self
.
options
[
"port"
]
path_shell
=
self
.
options
[
"path_shell"
]
config_file
=
self
.
options
[
"config_file"
]
path
=
self
.
options
[
"path"
]
)
# Configs
nginx_conf_file
=
self
.
createFile
(
self
.
options
[
'config_file'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_conf.in'
,
config
))
)
# Index default
nginx_index_file
=
self
.
createFile
(
'/'
.
join
([
root
,
"index.html"
),
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_index.in'
,
config
))
)
# Runners
runner_path
=
self
.
createExecutable
(
self
.
options
[
'path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_run.in'
),
config
))
return
[
runner_path
]
slapos/recipe/html5as/templates/nginx_conf.in
0 → 100644
View file @
7b4d9ecc
worker_processes %{nb_workers};
user nobody nogroup;
pid %{path_pid}/nginx.pid;
error_log %{path_log}/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log %{path_access_log}/nginx.access.log combined;
sendfile on;
server {
listen 80 default;
client_max_body_size 4G;
server_name _;
keepalive_timeout 5;
# path for static files
root %{root};
location / {
# checks for static file, if not found proxy to app
proxy_pass http://%{ip}:%{port}/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root %{root};
}
}
}
slapos/recipe/html5as/templates/nginx_index.in
0 → 100644
View file @
7b4d9ecc
<!doctype html>
<html>
<head></head>
<body>
<center>
<h2>
Nginx instance:
</h2>
<ul>
<li>
workers: %{nb_workers}
</li>
<li>
pid file : %{path_pid}
</li>
<li>
log file : %{path_log}
</li>
<li>
access log file : %{path_access_log}
</li>
<li>
root : %{root}
</li>
<li>
ip : %{ip}
</li>
<li>
port : %{port}
</li>
<li>
shell : %{path_shell}
</li>
<li>
config file : %{config_file}
</li>
<li>
server bin : %{path}
</li>
</ul>
</center>
</body>
</html>
\ No newline at end of file
slapos/recipe/html5as/templates/nginx_run.in
0 → 100644
View file @
7b4d9ecc
#!%(path_shell)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(path)s -c %(config_file)s
software/html5as/software.cfg
View file @
7b4d9ecc
...
@@ -7,7 +7,6 @@ extends =
...
@@ -7,7 +7,6 @@ extends =
parts =
parts =
nginx
nginx
html5as
[html5as]
[html5as]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment