From 9337b3ea39167fadd407802ff7c0de5d42eb36fa Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 25 Oct 2015 01:18:20 +0200 Subject: [PATCH] mod_http_upload: Add Nginx configuration snippet Include an example configuration snippet that shows how to tell Nginx to 1) proxy the HTTP PUT requests to mod_http_upload, and to 2) serve the HTTP GET requests directly. --- mod_http_upload/examples/nginx-upload.conf | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mod_http_upload/examples/nginx-upload.conf diff --git a/mod_http_upload/examples/nginx-upload.conf b/mod_http_upload/examples/nginx-upload.conf new file mode 100644 index 0000000..4035447 --- /dev/null +++ b/mod_http_upload/examples/nginx-upload.conf @@ -0,0 +1,25 @@ +server { + listen *:443 ssl; + server_name upload.example.com; + ssl_certificate /path/to/upload.example.com.crt; + ssl_certificate_key /path/to/upload.example.com.key; + + # The `docroot' used by mod_http_upload. + root /home/xmpp/upload; + + # Shouldn't be smaller than the `max_size' accepted by mod_http_upload. + client_max_body_size 100m; + + location / { + # Pass all requests to ejabberd, except for GET and HEAD requests. + limit_except GET { + proxy_pass http://localhost:5444; + } + proxy_set_header Host $host; + + if ($request_method = GET) { + add_header X-Frame-Options DENY; + } + add_header Strict-Transport-Security "max-age=31536000"; + } +}