w
This commit is contained in:
@@ -59,7 +59,7 @@ server {
|
||||
error_page 404 = @myownredirect;
|
||||
}
|
||||
|
||||
# debug url: /dbg/string
|
||||
# /dbg/shortcode | debug mode
|
||||
location ~ ^/dbg/(\w+) {
|
||||
default_type application/json;
|
||||
proxy_hide_header Content-Location;
|
||||
@@ -69,20 +69,18 @@ server {
|
||||
proxy_pass http://postgrest/rpc/fwd?p_shortcode=$1&p_dbg=true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# https://stackoverflow.com/questions/53353572/proxy-pass-cannot-have-uri-part-in-location-given-by-regular-expression
|
||||
|
||||
# /shortcode | normal mode
|
||||
location ~ ^/([A-Za-z0-9]+) {
|
||||
# rewrite ^/([A-Za-z0-9]+) /rpc/fwd?p_shortcode=$1&p_dbg=true break;
|
||||
# https://stackoverflow.com/questions/53353572/proxy-pass-cannot-have-uri-part-in-location-given-by-regular-expression
|
||||
rewrite ^/([A-Za-z0-9]+) /rpc/fwd break;
|
||||
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_method POST;
|
||||
proxy_set_body $args;
|
||||
proxy_method POST; # note, that if writing 'post' (lowercase) instead of 'POST' (uppercase), that will lead to the postgrest error "cannot use the post method on rpc"
|
||||
set $query_string $args;
|
||||
proxy_set_body $query_string;
|
||||
proxy_pass http://postgrest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user