Skip to content

Commit

Permalink
Add uwsgi examples, fixes horazont#3
Browse files Browse the repository at this point in the history
Add uwsgi ini and nginx config
  • Loading branch information
mt7479 committed Sep 26, 2018
1 parent 023c66e commit 22e8c59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contrib/nginx-example-uwsgi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Include this snippet in your nginx config.
# Make sure to preserve the trailing slashes if you change the location.
# Use this if you want to serve uploads from a subdirectory. The break statement
# is needed to remove the subdirectory when making the upstream request.

location /upload/ {
rewrite ^/upload/(.*) /$1 break;
include uwsgi_params;
uwsgi_pass uwsgi://localhost:9002;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100M;
}
19 changes: 19 additions & 0 deletions contrib/xmpp-http-upload.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Example ini for uwsgi usage. Adapt uid/gid to whatever user your webserver uses.
# This must also align with your directory permissions.
# env must point to your xhu config file.

[uwsgi]
socket = 0.0.0.0:9002
processes = 5
threads = 1
auto-procname = true
procname-prefix-spaced = [xmpp-http-upload]
uid = www-data
gid = www-data
need-plugin = python3
chdir = /opt/xmpp-http-upload/
pythonpath = /opt/xmpp-http-upload/
wsgi-file = /opt/xmpp-http-upload/xhu.py
enable-threads = true
offload-threads = 10
env = XMPP_HTTP_UPLOAD_CONFIG=/opt/xmpp-http-upload/config.yml

0 comments on commit 22e8c59

Please sign in to comment.