Score:0

how to prevent redirect cloudflare origin domain when we do reverse proxy on nginx

cn flag

im having problem with my reverse proxy config on nginx, how can i stop domain that using cloudflare to not redirecting to their original domain when we reversing proxy ?

    listen 443 ssl;
server_name 234.234.234.234;
ssl_certificate /etc/ssl/cert.crt;
ssl_certificate_key /etc/ssl/private.key;
error_log /var/log/nginx/sports_error.log;
location / {
    proxy_ssl_server_name on;
    proxy_pass http://www.abc.xyz/;

when i access 234.234.234.234 the url address is keep changing to https://www.abc.xyz i've tried to add

proxy_redirect 0ff;

but still no luck.

HBruijn avatar
in flag
Your reverse proxy makes a plain http connection `proxy_pass http://www.abc.xyz/;` and probably the backend site doesn't allow plain http and sends a redirect to the https version of their site. Try `proxy_pass https://www.abc.xyz/;` and that redirect shouldn't be necessary anymore. But the backend site may have other checks and controls to ensure that it always accessed by its own URL to prevent reverse proxying and other abuse
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.