Rush
Rush
Explore posts from servers
CDCloudflare Developers
Created by Rush on 3/29/2024 in #general-help
i am getting http instead of https on my reverse proxy
Hello, from cloudflare I have a domain pointed to my own reverse proxy, it points to the docker container of my laravel application. Even though I'm using cloudflare https, my reverse proxy is passing x-forwarded-proto http to laravel, which is wrong. It has the result that, for example, urls are generated for me with http, even if I want them with https. This is my nginx configuration:
server {
listen 80;
listen [::]:80;

server_name mydomain.com;

location / {
proxy_pass http://my-app-app-1;

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 X-Forwarded-Uri $request_uri;
proxy_set_header X-Forwarded-Host $host;
}
}
server {
listen 80;
listen [::]:80;

server_name mydomain.com;

location / {
proxy_pass http://my-app-app-1;

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 X-Forwarded-Uri $request_uri;
proxy_set_header X-Forwarded-Host $host;
}
}
12 replies