unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Ali Alnubani <alialnu@mellanox.com>
To: "meta@public-inbox.org" <meta@public-inbox.org>
Cc: "e@80x24.org" <e@80x24.org>
Subject: [PATCH] examples: add sample nginx configuration
Date: Tue, 4 Jun 2019 09:22:27 +0000	[thread overview]
Message-ID: <20190604092145.1941-1-alialnu@mellanox.com> (raw)

The sample configuration can be used to proxy-pass requests
to public-inbox-httpd or to a standalone PSGI/Plack server.
---
 examples/nginx_proxy | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 examples/nginx_proxy

diff --git a/examples/nginx_proxy b/examples/nginx_proxy
new file mode 100644
index 0000000..d8d1e6d
--- /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;
+}
+
-- 
2.21.0


             reply	other threads:[~2019-06-04  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04  9:22 Ali Alnubani [this message]
2019-06-04 10:24 ` [PATCH] examples: add sample nginx configuration Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190604092145.1941-1-alialnu@mellanox.com \
    --to=alialnu@mellanox.com \
    --cc=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).