/ postgrest wip
This commit is contained in:
@@ -53,13 +53,28 @@ server {
|
|||||||
|
|
||||||
# postgrest reverse proxy
|
# postgrest reverse proxy
|
||||||
location / {
|
location / {
|
||||||
default_type application/json;
|
error_page 404 = @myownredirect;
|
||||||
proxy_hide_header Content-Location;
|
|
||||||
add_header Content-Location /rpc/$upstream_http_content_location;
|
|
||||||
#proxy_set_header Connection "";
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_pass http://postgrest/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# support /string url style
|
||||||
|
location ~ ^/(\w+) {
|
||||||
|
|
||||||
|
# # make the response singular
|
||||||
|
# proxy_set_header Accept 'application/vnd.pgrst.object+json';
|
||||||
|
|
||||||
|
# assuming an upstream named "postgrest"
|
||||||
|
proxy_pass http://postgrest/$1?id=eq.$2;
|
||||||
|
|
||||||
|
default_type application/json;
|
||||||
|
proxy_hide_header Content-Location;
|
||||||
|
add_header Content-Location /rpc/$upstream_http_content_location;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_pass http://postgrest/rpc/fwd?p_shortcode=$1;
|
||||||
|
|
||||||
|
#http://178.156.192.201:3000/rpc/fwd?p_shortcode=ph25&p_dbg=false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user