Hello, I have two servers. server A and server B. My main website is hosted on server A. Can I install reverse proxy on server B via AAPANEL so that If I put server B IP in cloudflare DNS then my website opens from server A?
reverse proxy
Hello sirfpsycho
There is no problem in principle
Can you please guide me how can I do that?
- Create example.com website in A server
- Create an empty site on server B using your domain name
- Add a reverse proxy on server B
Target URL:http://x.x.x.x
your server a ip
Sent Domain:example.com
your server a domain name
- Resolve your domain name a record to server b in cloudflare
aaPanel_Jose thank you it is working fine. There an option for enable cache. Should I enable it? Any benifit ?
Caching is always good, can save much resources.
When you have Wordpress site, then Cloudflare + WPRocket or any 1 cache plugin is enough.
I enabled cache for reverse proxy but what is the recommended cache minutes hours? leave it as default 1min ?
Can someone help please? when I enable cache in reverse proxy, can't log in in wp-admin of my site.
jabr don't enable cache in reverse proxy. After enabling cache login issue comes.
- Create example.com website in A server
- Create an empty site on server B using your domain name
Is your domain name on point number 2 a random domain or it should be the same as example.com on point number 1?
How to fix the problem cannot login after enable cache?
x3inspire
Hi. Is it okay to turn off the cache?
aaPanel_Kern
I prefer to enable the cache
x3inspire
So can you log in when not enabled?
aaPanel_Kern
yes, after disable the cache i can login.
x3inspire
What error message is there when I log in after enabling the cache? Check logs and error logs
Cache these files after opening the cache gif|png|jpg|css|js|woff|woff2
You can modify the Conf to remove the affected files
aaPanel_Kern
The log error i should check on proxy server or main server?
x3inspire
need to check
Hi, i think i manage to make the reverse proxy working... i test it by typing the server B's domain(i use my direct ip) and it directs me to server A website, but the url changes to server A's domain. how to be able to show the server A content while the url still from the server B's domain?
Considering you're talking about reverse proxy and not redirect, you should be able to fine tune any detail about it. Maybe try to indicate the domain you want to display in the address bar in the headers, like this, beside the proxy_pass directive:
proxy_set_header Host server_b_domain;