I am changing the domain name of my app from old.com to new.com
My app is connected to external APIs that send data through webhooks, and I would like to redirect the webhooks sent to the old url, so that they hit the new url and get processed.
I have a tried a plain rewrite
server {
server_name old.com;
listen 443 ssl;
rewrite ^ https://new.com$request_uri;
I can see this triggers a 302 redirection, but that doesn't seem to do the trick..
I tried with a proxy_pass
server {
server_name old.com;
listen 443 ssl;
location /webHook {
proxy_pass https://new.com/webHook;
}
rewrite ^ https://new.com$request_uri;
Same result.. I can see a 302 redirect in the logs, but the webhook never seem to hit the new URL and doesn't get processed..
Any idea on how to achieve that?