From 27cfc585e6019f8d170e8be505d9b837cfd27bbd Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 10 Jan 2022 07:16:57 +0100 Subject: [PATCH] own backend webhook endpoint definition in nginx to handle webhook properly --- .../nginx/sites-available/gradido.conf.ssl.template | 13 +++++++++++++ .../nginx/sites-available/gradido.conf.template | 13 +++++++++++++ nginx/gradido.conf | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template index 73b45bf56..435949d7e 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -57,6 +57,19 @@ server { proxy_redirect off; } + # Backend webhooks + location /hook { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + proxy_pass http://backend:4000; + proxy_redirect off; + } + # Admin Frontend location /admin { proxy_http_version 1.1; diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.template index f5494b248..0ebdc36d7 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.template @@ -42,6 +42,19 @@ server { proxy_redirect off; } + # Backend webhooks + location /hook { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + proxy_pass http://backend:4000; + proxy_redirect off; + } + # Admin Frontend location /admin { proxy_http_version 1.1; diff --git a/nginx/gradido.conf b/nginx/gradido.conf index fe5a60363..820e4a705 100644 --- a/nginx/gradido.conf +++ b/nginx/gradido.conf @@ -42,6 +42,19 @@ server { proxy_redirect off; } + # Backend webhooks + location /hook { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + proxy_pass http://backend:4000; + proxy_redirect off; + } + # Admin Frontend location /admin { proxy_http_version 1.1;