forked from horazont/xmpp-http-upload
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add uwsgi examples, fixes horazont#3
Add uwsgi ini and nginx config
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |