From 5b95d22e2ad44343cf9b6eb5cd47b8137ea3cdc1 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Sun, 27 Nov 2016 12:28:10 -0800 Subject: [PATCH] Base nginx conf from Ruslan --- admin.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/admin.rst b/admin.rst index a7d145d7f..b5bcb3521 100644 --- a/admin.rst +++ b/admin.rst @@ -71,9 +71,30 @@ PostgREST is a fast way to construct a RESTful API. Its default behavior is grea The first step is to create an Nginx configuration file that proxies requests to an underlying PostgREST server. -.. code:: +.. code:: nginx - Nginx code goes here. + http { + ... + # upstream configuration + upstream postgrest { + server localhost:3000; + keepalive 64; + } + ... + server { + ... + # expose to the outside world + location /api { + default_type application/json; + proxy_hide_header Content-Location; + add_header Content-Location /api$upstream_http_content_location; + proxy_set_header Connection ""; + proxy_http_version 1.1; + proxy_pass http://postgrest/; + } + ... + } + } Block Full-Table Operations ---------------------------