Skip to content

Instantly share code, notes, and snippets.

@jamesseanwright
Created July 18, 2021 16:50
Show Gist options
  • Save jamesseanwright/9d22b4a2ac0246a12fc1b0a89d694e16 to your computer and use it in GitHub Desktop.
Save jamesseanwright/9d22b4a2ac0246a12fc1b0a89d694e16 to your computer and use it in GitHub Desktop.
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