inital project layout
This commit is contained in:
commit
3c5ce29f67
11 changed files with 325 additions and 0 deletions
20
etc/init/oxbrowser.conf
Normal file
20
etc/init/oxbrowser.conf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# oxbrowser gunicorn daemon
|
||||
#
|
||||
|
||||
description "oxbrowser daemon"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
kill timeout 5
|
||||
respawn
|
||||
|
||||
env VENV=/srv/oxbrowser
|
||||
env USER=oxbrowser
|
||||
env HOME=/home/oxbrowser
|
||||
|
||||
script
|
||||
test -e /var/log/oxbrowser || (mkdir -p /var/log/oxbrowser && chown $USER:$USER /var/log/oxbrowser)
|
||||
test -e /var/run/oxbrowser || (mkdir -p /var/run/oxbrowser && chown $USER:$USER /var/run/oxbrowser)
|
||||
cd $VENV/oxbrowser
|
||||
exec /usr/bin/sudo -u $USER $VENV/bin/gunicorn_django --bind unix:/var/run/oxbrowser/gunicorn.sock --timeout 90 --log-level info --log-file /var/log/oxbrowser/oxbrowser.log --workers 5 $VENV/oxbrowser/settings.py
|
||||
end script
|
||||
52
etc/nginx/sites-available/oxbrowser.conf
Normal file
52
etc/nginx/sites-available/oxbrowser.conf
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
upstream gunicorn_oxbrowser {
|
||||
server unix:///var/run/oxbrowser/gunicorn.sock fail_timeout=0;
|
||||
}
|
||||
server {
|
||||
listen 80 default;
|
||||
#server_name pandora.example.com;
|
||||
|
||||
access_log /var/log/nginx/oxbrowser.access.log;
|
||||
error_log /var/log/nginx/oxbrowser.error.log;
|
||||
|
||||
location /admin/media {
|
||||
root /srv/oxbrowser/src/django/django/contrib;
|
||||
autoindex on;
|
||||
}
|
||||
location /favicon.ico {
|
||||
root /srv/oxbrowser/static;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
root /srv/oxbrowser;
|
||||
autoindex on;
|
||||
}
|
||||
location /data/ {
|
||||
internal;
|
||||
root /srv/oxbrowser;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_read_timeout 90; #should be in sync with gunicorn timeout
|
||||
proxy_connect_timeout 90; #should be in sync with gunicorn timeout
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://gunicorn_oxbrowser;
|
||||
#proxy_pass http://127.0.0.1:XXXX;
|
||||
break;
|
||||
}
|
||||
client_max_body_size 32m;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
location /404.html {
|
||||
root /srv/oxbrowser/static;
|
||||
}
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location /50x.html {
|
||||
root /srv/oxbrowser/static;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue