]> Sergey Matveev's repositories - public-inbox.git/blob - examples/nginx_proxy
No ext_urls
[public-inbox.git] / examples / nginx_proxy
1 # Example NGINX configuration to proxy-pass requests
2 # to varnish, public-inbox-(httpd|netd) or any PSGI/Plack server.
3 # The daemon is assumed to be running locally on port 8001.
4 # Adjust ssl certificate paths if you use any, or remove
5 # the ssl configuration directives if you don't.
6 #
7 # Note: public-inbox-httpd and -netd both support HTTPS, but they
8 # don't support caching which Varnish provides.  The recommended
9 # setup is currently:
10 #
11 #   (nginx|any-HTTPS-proxy) <-> varnish <-> public-inbox-(httpd|netd)
12 server {
13         server_name _;
14         listen 80;
15
16         access_log /var/log/nginx/public-inbox-httpd_access.log;
17         error_log /var/log/nginx/public-inbox-httpd_error.log;
18
19         location ~* ^/(.*)$ {
20                 proxy_set_header    HOST $host;
21                 proxy_set_header    X-Real-IP $remote_addr;
22                 proxy_set_header    X-Forwarded-Proto $scheme;
23                 proxy_buffering off; # lowers response latency
24                 proxy_pass          http://127.0.0.1:8001$request_uri;
25         }
26
27         listen 443 ssl;
28         ssl_certificate /path/to/certificate.pem;
29         ssl_certificate_key /path/to/certificate_key.pem;
30 }
31