]> Sergey Matveev's repositories - public-inbox.git/commitdiff
examples: add sample nginx configuration
authorAli Alnubani <alialnu@mellanox.com>
Tue, 4 Jun 2019 09:22:27 +0000 (09:22 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Jun 2019 10:22:13 +0000 (10:22 +0000)
The sample configuration can be used to proxy-pass requests
to public-inbox-httpd or to a standalone PSGI/Plack server.

examples/nginx_proxy [new file with mode: 0644]

diff --git a/examples/nginx_proxy b/examples/nginx_proxy
new file mode 100644 (file)
index 0000000..38e6064
--- /dev/null
@@ -0,0 +1,24 @@
+# Example NGINX configuration to proxy-pass requests\r
+# to public-inbox-httpd or to a standalone PSGI/Plack server.\r
+# The daemon is assumed to be running locally on port 8001.\r
+# Adjust ssl certificate paths if you use any, or remove\r
+# the ssl configuration directives if you don't.\r
+server {\r
+       server_name _;\r
+       listen 80;\r
+\r
+       access_log /var/log/nginx/public-inbox-httpd_access.log;\r
+       error_log /var/log/nginx/public-inbox-httpd_error.log;\r
+\r
+       location ~* ^/(.*)$ {\r
+               proxy_set_header    HOST $host;\r
+               proxy_set_header    X-Real-IP $remote_addr;\r
+               proxy_set_header    X-Forwarded-Proto $scheme;\r
+               proxy_pass          http://127.0.0.1:8001$request_uri;\r
+       }\r
+\r
+       listen 443 ssl;\r
+       ssl_certificate /path/to/certificate.pem;\r
+       ssl_certificate_key /path/to/certificate_key.pem;\r
+}\r
+\r