0

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.

1
  • 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
    – HBruijn
    May 12, 2023 at 8:23

0

You must log in to answer this question.

Browse other questions tagged .