[extensions-web/django/upgrade-1.8] Added sample nginx/uwsgi/systemd configuration files.



commit da8784155249b6d91f8da6065ed3ff9e6417caf5
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sun Oct 30 13:35:05 2016 +0300

    Added sample nginx/uwsgi/systemd configuration files.

 etc/sweettooth.nginx.conf.example      |   61 ++++++++++++++++++++++++++++++++
 etc/sweettooth.systemd.service.example |   10 +++++
 etc/wsgi.ini.example                   |   16 ++++++++
 3 files changed, 87 insertions(+), 0 deletions(-)
---
diff --git a/etc/sweettooth.nginx.conf.example b/etc/sweettooth.nginx.conf.example
new file mode 100644
index 0000000..0ef05d2
--- /dev/null
+++ b/etc/sweettooth.nginx.conf.example
@@ -0,0 +1,61 @@
+server {
+    server_name  extensions.gnome.org;
+
+    charset utf-8;
+    access_log  /var/log/nginx/extensions.gnome.org.access.log main;
+
+    root /srv/sweettooth/www;
+
+    if (-f /etc/nginx/maintance/extensions.gnome.org) {
+        return 403;
+    }
+
+    listen  80;
+    listen  [::]:80;
+    listen  443 ssl http2;
+    listen  [::]:443 ssl http2;
+
+    ssl_certificate         /etc/nginx/certs/fullchain.pem;
+    ssl_certificate_key     /etc/nginx/certs/privkey.pem;
+    ssl_trusted_certificate /etc/nginx/certs/chain.pem;
+
+    add_header Strict-Transport-Security "max-age=31536000";
+
+    location ~ /\. {
+        deny all;
+    }
+
+    location = /favicon.ico {
+        log_not_found off;
+        access_log off;
+    }
+
+    location = /robots.txt {
+        allow all;
+        log_not_found off;
+        access_log off;
+    }
+
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root /usr/share/nginx/html;
+    }
+
+    location /extensions-data/ {
+        alias /srv/sweettooth/extensions-web/extensions-data/;
+    }
+
+    location /static/ {
+        alias /srv/sweettooth/www/;
+
+        location ~* \.(jpg|jpeg|gif|png|ico|css|pdf|txt|bmp|js)$ {
+            access_log off;
+            expires 3d;
+        }
+    }
+
+    location / {
+        uwsgi_pass  unix:/run/sweettooth/sweettooth.sock;
+        include     uwsgi_params;
+    }
+}
diff --git a/etc/sweettooth.systemd.service.example b/etc/sweettooth.systemd.service.example
new file mode 100644
index 0000000..2a785e3
--- /dev/null
+++ b/etc/sweettooth.systemd.service.example
@@ -0,0 +1,10 @@
+[Unit]
+Description=SweetTooth-Web
+After=syslog.target
+
+[Service]
+ExecStart=/bin/bash -c 'source /srv/sweettooth/venv/bin/activate; uwsgi --ini /srv/sweettooth/wsgi.ini'
+RuntimeDirectory=sweettooth
+
+[Install]
+WantedBy=multi-user.target
diff --git a/etc/wsgi.ini.example b/etc/wsgi.ini.example
new file mode 100644
index 0000000..e12afc3
--- /dev/null
+++ b/etc/wsgi.ini.example
@@ -0,0 +1,16 @@
+[uwsgi]
+wsgi-file = /srv/sweettooth/extensions-web/sweettooth/wsgi.py
+chdir = /srv/sweettooth/extensions-web
+
+master = true
+processes = 5
+
+socket = /run/sweettooth/sweettooth.sock
+uid=sweettooth
+gid=sweettooth
+protocol = uwsgi
+chown-socket = sweettooth:www-data
+chmod-socket = 660
+vacuum = true
+
+die-on-term = true


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]