Mobile app version of vmapp.org
Login or Join
Kaufman445

: How do I set up a "gateway" for a specific subdomain? I'm looking at setting up a website that will run a few different apps. Most of them can be managed by an Apache server, but I've

@Kaufman445

Posted in: #Apache #Subdomain

I'm looking at setting up a website that will run a few different apps. Most of them can be managed by an Apache server, but I've got one specific thing that will run on a custom HTTP server.

Looking around on apache.org, it looks like you can use mod_proxy to configure Apache to act as a "reverse proxy" and forward requests from a specific subdirectory to a new server with the ProxyPass directive. So if I wanted send anything from mysite.com/special on to the custom server, that's how I would do it.

But what if I want to set it up as a subdomain instead? The documentation doesn't seem to cover that. If, I wanted to make it forward anything from special.mysite.com to the new server, how would I set that up?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

1 Comments

Sorted by latest first Latest Oldest Best

 

@Carla537

If it's only HTTP traffic:

<VirtualHost *:80>
ServerName special.mysite.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / 127.0.0.1:8081/ ProxyPassReverse / 127.0.0.1:8081/ <Location />
Allow from all
</Location>
</VirtualHost>


(This assumes your "special" server runs on 8081. Change that URL to wherever it runs.)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme