diff --git a/nginx.conf b/nginx.conf index e3b8790fc..86d3c2b6d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -26,6 +26,10 @@ http { server cleezy-app:8000; } + upstream smee2 { + server smee2:5000; + } + server { #re-routing http to https server listen 80 default_server; @@ -158,6 +162,26 @@ http { return 404 "oops! we couldnt load your interview question lol, i guess this ones free!"; } + # Route GitHub Webhooks to the gateway + location ~ ^/webhook/(?.*)$ { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_pass http://smee2/webhook/$alias; + } + + # Route the WebSocket connection over the same port + location ~ ^/tunnel/(?.*)$ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + + proxy_pass http://smee2/tunnel/$alias; + } + #Load balancer location /api/scevents/ { resolver 127.0.0.11 valid=15s;