Use reverse proxy on XAMPP

Hello,

Currently, I’m running a local media server on my home computer. it’s using the address of http://localhost:8096. I’ve Used reverse proxy to access the website via http://localhost address.

The code I’ve used for the vhost.conf file is down below.

<VirtualHost *:80>
	ProxyRequests On
	<Proxy>
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPass / http://localhost:8096/
	ProxyPassReverse / http://localhost:8096/
	ServerName localhost
	Header set Access-Control-Allow-Origin "*"
</VirtualHost>

I want to know how can I use my domain name instead of “localhost” to access my server via reverse proxy. Can someone help me, please?

Thank you.

I assume you mean you want to reach the reverse proxy under your domain name. In the reverse proxy configuration you only need to adjust the ServerName. And then you need to point the DNS entry for your domain at the reverse proxy.

That said, for a server reachable outside localhost you really should set up TLS for security. :slightly_smiling_face:

Hello, Thank you so much for your reply. I happy to tell you it actually works very well. Again thank you so much :slight_smile:

1 Like