Does anyone know how to have nginx reverse proxy communicate to Odoo so it uses https for stripe webhooks instead of http?
I have a Odoo docker container running over https with an nginx container as a reverse proxy. Everything works for the most part except when I try to generate or use the Stripe payment webhook Odoo is creating it with http instead of https protocol. While this technically is working, it should be secured.
It seems Odoo is getting the http protocol from the proxy_pass line in the nginx configuration, where I'm using http to pass traffic to the Odoo container.
I'm not a python developer, but I think it is related to this chunk of code in payment_provider code on GitHub. I wasn't able to figure out why it wasn't working based on that though.
My nginx configuration file is below to show what I have currently after swapping out the hostname with comments in areas where I was trying to pass https protocol, but failed. Appreciate any help, hints or feedback.
## Set appropriate X-Forwarded-Ssl header map $scheme $proxy_x_forwarded_ssl { default off; https on; } upstream test-stream { server odoo:8069; } server { listen 80; listen [::]:80; server_name example.com www.example.com; # ACME-challenge used by Certbot for Let's Encrypt location ^~ /.well-known/acme-challenge/ { root /var/www/certbot; } location / { rewrite ^ https://$host$request_uri? permanent; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com; # removed cert, logs, and etc. related lines for brevity # Tried this line before the location block to pass https, not working proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; location / { proxy_pass http://test-stream; proxy_set_header Host $host; ##################### # Tried the following lines to pass https, but none worked #################### proxy_set_header Scheme https; proxy_set_header X-Forwarded-Scheme https; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto https; } }