# Feasible to reverse proxy using qualifier in URL?

**URL:** https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623
**Category:** Support
**Created:** [2015年九月23日 00:39 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623 "2015-09-23T00:39:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ckamps](https://avatars.discourse-cdn.com/v4/letter/c/e95f7d/32.png) [@ckamps](https://meta.discourse.org/u/ckamps)
#### Post date: [2015年九月23日 00:39 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/1 "2015-09-23T00:39:27Z")

</div>

I’ve seen many references to configuring reverse proxies to map “/” to a backend Discourse site, but I haven’t seen examples where something other than slash is mapped. For example, I would like to establish a reverse proxy to map multiple Discourse sites by qualifying the URL after the host/domain name.

```
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /meta/ http://<IP address 1>/
ProxyPassReverse /meta/ http://<IP address 1>/
ProxyPass /foo/ http://<IP address 2>/
ProxyPassReverse /foo/ http://<IP address 2>/

```

When this approach is taken, the main page is loaded, but all references back to the site lack the “/meta/” qualifier and result in 404s.

Is it feasible to prefix Discourse sites addresses in this manner?

I’d prefer not to use different FQDNs to distinguish between sites.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2015年九月23日 00:51 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/2 "2015-09-23T00:51:15Z")

</div>

Set the `relative_url_root` option in your `discourse.conf` to the path prefix for each instance (eg `relative_url_root = /meta`). This should instruct Rails to generate paths with the specified prefix prepended. You’ll need to restart the app in order for the setting to take effect.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2015年九月23日 00:58 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/3 "2015-09-23T00:58:03Z")

</div>

Here’s the guide on subfolder:

> [@Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/subfolder-support-with-docker/30507):
>
> warning Discourse Official Statement about Subfolder setup We support subfolder setups for our hosted customers at the enterprise level and up. Due to heavy technical setup complexity we strongly recommend you do not use this setup unless you are very experienced in custom subfolder setups. It is critical you have a deep understanding of NGINX setup in the Discourse Docker container Secure original IP forwarding using custom headers in the proxy chain Rate limiting in front proxy server I…

---

<div class="post-metadata">

### Author: ![ckamps](https://avatars.discourse-cdn.com/v4/letter/c/e95f7d/32.png) [@ckamps](https://meta.discourse.org/u/ckamps)
#### Post date: [2015年九月26日 15:27 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/4 "2015-09-26T15:27:28Z")

</div>

Excellent. Worked great! Per the discussion posts, I had to also set the `long polling base url` to specify the subfolder in the form of `/subfolder/`, but once that was done uploads and some other features started working properly.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2018年十一月10日 02:09 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/5 "2018-11-10T02:09:11Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年十一月12日 05:43 UTC](https://meta.discourse.org/t/feasible-to-reverse-proxy-using-qualifier-in-url/33623/6 "2018-11-12T05:43:43Z")

</div>


