Created
February 2, 2017 12:50
-
-
Save fab1an/99e5fd48d7ab52349225f2bb80a85941 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# target server | |
upstream postgrest { | |
server localhost:4000; | |
keepalive 64; | |
} | |
# proxy | |
server { | |
listen 3000; | |
# forward /api/* to postgrest | |
location /api/ { | |
proxy_pass http://postgrest/; | |
} | |
# forward /urlauth/<TOKEN>/* to postgrest and set Authorization-header from URL | |
location ~ ^/urlauth/(.*)/(.*)$ { | |
proxy_set_header Authorization "Bearer $1"; | |
proxy_pass http://postgrest/$2$is_args$args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment