/ postgrest reverse proxy

This commit is contained in:
fro
2025-10-29 03:14:54 -05:00
parent 5d7e04907a
commit abf14a0060

View File

@@ -22,12 +22,10 @@ server {
# return 301 $scheme://op.fo$request_uri; # return 301 $scheme://op.fo$request_uri;
#} #}
# ... # upstream configuration for postgrest (used as reversed proxy)
# upstream configuration upstream postgrest {
upstream postgrest {
server localhost:3000; server localhost:3000;
} }
server { server {
listen 443 ssl; listen 443 ssl;
@@ -45,16 +43,16 @@ server {
server_name fw.op.fo; server_name fw.op.fo;
# redirect 404 not found to the root # redirect 404 not found to the root
location / { #location / {
error_page 404 = @myownredirect; # error_page 404 = @myownredirect;
} #}
location @myownredirect { location @myownredirect {
return 302 /; return 302 /;
} }
# postgrest reverse proxy # postgrest reverse proxy
location /rpc/ { location / {
default_type application/json; default_type application/json;
proxy_hide_header Content-Location; proxy_hide_header Content-Location;
add_header Content-Location /rpc/$upstream_http_content_location; add_header Content-Location /rpc/$upstream_http_content_location;