Nginx reverse proxy for Strapi Cloud

I’m trying to configure reverse proxy for Strapi Cloud in nginx server.

This is my nginx conf for Strapi Cloud

location ^~ /api/ {
proxy_ssl_server_name on;
proxy_pass https://gorgeous-breeze-41f8732c57.strapiapp.com;
include /etc/nginx/conf.d/proxy_params;
}

proxy_params file contains the next code.

proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $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_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;

But I keep getting the next error message.

403 Forbidden

403 Forbidden


cloudflare

When I googled it, someone said this error is caused by https handshaking process. But I don’t know how to fix it.

If someone had similar experience, please share your knowledge or experience.

Thank you all in advance.

This topic has been created from a Discord post (1227913239703191652) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord