about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorAli Alnubani <alialnu@mellanox.com>2019-06-04 09:22:27 +0000
committerEric Wong <e@80x24.org>2019-06-04 10:22:13 +0000
commitcfc09915c3b7779d84cf5cfda628084e8964db78 (patch)
tree881169054b44154232388017db002e00a37c6b92
parentb77c87a6fce05c4f2048aa0a73fde7b25a2b0002 (diff)
downloadpublic-inbox-cfc09915c3b7779d84cf5cfda628084e8964db78.tar.gz
The sample configuration can be used to proxy-pass requests
to public-inbox-httpd or to a standalone PSGI/Plack server.
-rw-r--r--examples/nginx_proxy24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/nginx_proxy b/examples/nginx_proxy
new file mode 100644
index 00000000..38e60643
--- /dev/null
+++ b/examples/nginx_proxy
@@ -0,0 +1,24 @@
+# Example NGINX configuration to proxy-pass requests
+# to public-inbox-httpd or to a standalone PSGI/Plack server.
+# The daemon is assumed to be running locally on port 8001.
+# Adjust ssl certificate paths if you use any, or remove
+# the ssl configuration directives if you don't.
+server {
+        server_name _;
+        listen 80;
+
+        access_log /var/log/nginx/public-inbox-httpd_access.log;
+        error_log /var/log/nginx/public-inbox-httpd_error.log;
+
+        location ~* ^/(.*)$ {
+                proxy_set_header    HOST $host;
+                proxy_set_header    X-Real-IP $remote_addr;
+                proxy_set_header    X-Forwarded-Proto $scheme;
+                proxy_pass          http://127.0.0.1:8001$request_uri;
+        }
+
+        listen 443 ssl;
+        ssl_certificate /path/to/certificate.pem;
+        ssl_certificate_key /path/to/certificate_key.pem;
+}
+