Created
July 18, 2021 16:50
-
-
Save jamesseanwright/9d22b4a2ac0246a12fc1b0a89d694e16 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
load_module /usr/lib/nginx/modules/ngx_http_js_module.so; | |
events {} | |
http { | |
js_import integration.js; | |
map $downstream_method $handler_host { | |
POST "add-event"; | |
GET "get-events"; | |
} | |
# Docker's embedded DNS server | |
resolver 127.0.0.11; | |
server { | |
listen 80; | |
location /integration { | |
internal; | |
proxy_pass http://$handler_host:8080/2015-03-31/functions/function/invocations; | |
} | |
location /events { | |
set $downstream_method $request_method; | |
js_content integration.invoke; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment