I am trying to redirect a online website such as amazon.com for example to a website using cloudflare such as chat.openai.com. The problem is that you can not obtain the IP address from a website using cloudflare which means we can not use a DNS since it needs the IP address where it needs to redirect to.
So I found something on Apache2
using Kali Linux VMware that uses a Reverse Proxy.
I don't 100% know how exactly it works but I know it gets the same result as a DNS server.
Instead you need the URL
and the IP
, you need the domain
and the URL
.
Getting the IP
of a website using cloudflare denies direct access and can only be forwarded with a HTTP
query.
I searched around online but only ChatGPT got me this far but still doesn't fix the issue.
So I have a conf
file in /etc/apache2/sites-enabled/
named ReverseProxy.conf
with the following code:
<VirtualHost *:80>
ServerName amazon.com
ProxyPreserveHost On
ProxyPass / https://chat.openai.com/
ProxyPassReverse / https://chat.openai.com/
</VirtualHost>
I also have installed two mods named proxy
and proxy_http
and have them installed using the a2enmod
command.
Whenever I start or restart Apache2
nothing changes (visiting amazon.com remains amazon).
I've tried changing the PORT
to 443
or adding "www." before amazon.com but that doesn't work.
I saw something that I need a valid SSL but I don't understand why I need it and how to add it.
Could anyone please explain or help me solving this issue?