# Hitting Mautic landing pages via proxy

**URL:** <https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200>\
**Category:** Product Support\
**Created:** [January 17, 2017, 6:32pm UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200 "2017-01-17T18:32:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brandner/32/153_2.png) [@brandner](https://forum.mautic.org/u/brandner)\
**Post date:** [January 17, 2017, 6:32pm UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200/1 "2017-01-17T18:32:30Z")

</div>

I am testing the concept of using a reverse proxy to access landing pages.  
  
Let’s say we have Mautic hosted at [m.onedomain.com](http://m.onedomain.com) . We are trying to see if we can server landing pages at [www.otherdomain.com](http://www.otherdomain.com).  
  
I have it set up, but when I hit Mautic through the proxy it gives me a 404.  
  
  
  
I check the logs, and my request is hitting the right Apache host, and the right path.  
  
  
  
Any thoughts on what I might look at? Could the application be grabbing my request, noticing the different domain, and throwing a 404 back at me?  
  
  
  
Request to [http://www.otherdomain.com/category/test-landing-page](http://www.otherdomain.com/category/test-landing-page) via IIS proxy

Code:

10.x.x.x - - [17/Jan/2017:10:16:50 -0800] "GET /category/test-landing-page HTTP/1.1" 404 60813 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) ... Chrome/55.0.2883.87 Safari/537.36"

  
Request to http://m.onedomain.com/category/test-landing-page directly

Code:

10.x.x.x - - [17/Jan/2017:10:17:05 -0800] "GET /category/test-landing-page HTTP/1.1" 200 3213 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) ... Chrome/55.0.2883.87 Safari/537.36"

---

<div class="post-metadata">

**Author:** ![brandner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brandner/32/153_2.png) [@brandner](https://forum.mautic.org/u/brandner)\
**Post date:** [January 17, 2017, 6:32pm UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200/2 "2017-01-17T18:32:30Z")

</div>

I am testing the concept of using a reverse proxy to access landing pages.  
Let’s say we have Mautic hosted at [m.onedomain.com](http://m.onedomain.com) . We are trying to see if we can server landing pages at [www.otherdomain.com](http://www.otherdomain.com).  
I have it set up, but when I hit Mautic through the proxy it gives me a 404.

I check the logs, and my request is hitting the right Apache host, and the right path.

Any thoughts on what I might look at? Could the application be grabbing my request, noticing the different domain, and throwing a 404 back at me?

Request to [http://www.otherdomain.com/category/test-landing-page](http://www.otherdomain.com/category/test-landing-page) via IIS proxy

```auto
10.x.x.x - - [17/Jan/2017:10:16:50 -0800] "GET /category/test-landing-page HTTP/1.1" 404 60813 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) ... Chrome/55.0.2883.87 Safari/537.36"
```

Request to [http://m.onedomain.com/category/test-landing-page](http://m.onedomain.com/category/test-landing-page) directly

```auto
10.x.x.x - - [17/Jan/2017:10:17:05 -0800] "GET /category/test-landing-page HTTP/1.1" 200 3213 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) ... Chrome/55.0.2883.87 Safari/537.36"
```

---

<div class="post-metadata">

**Author:** ![brandner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brandner/32/153_2.png) [@brandner](https://forum.mautic.org/u/brandner)\
**Post date:** [January 17, 2017, 7:05pm UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200/3 "2017-01-17T19:05:57Z")

</div>

Oh, great suggestion.

Both domains are available to each other (Mautic can ping and ‘wget’ pages from alternative domain and alternate domain can ping and browse Mautic).

---

<div class="post-metadata">

**Author:** ![brandner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brandner/32/153_2.png) [@brandner](https://forum.mautic.org/u/brandner)\
**Post date:** [January 17, 2017, 7:14pm UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200/4 "2017-01-17T19:14:12Z")

</div>

Yes, and correct. IIS and AAR.  
Seems to proxy through properly, according to Apache logs on Mautic server. Almost feels like I need an Apache or Mautic setting change.

Rough web.config on IIS:

`<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://m.onedomain.com/{R:1}" />
                    <serverVariables> 
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables> 
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>`

---

<div class="post-metadata">

**Author:** ![brandner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brandner/32/153_2.png) [@brandner](https://forum.mautic.org/u/brandner)\
**Post date:** [January 18, 2017, 12:15am UTC](https://forum.mautic.org/t/hitting-mautic-landing-pages-via-proxy/7200/5 "2017-01-18T00:15:08Z")

</div>

I think I figured it out. The IIS proxy set up works great, the issue comes when I try to use a different path than what Mautic wants. For example, these don’t seem to be possible:

- [http://otherdomain.com/folder/category/test-landing-page](http://otherdomain.com/folder/category/test-landing-page) -\> proxy -\> [http://mauticdomain.com/category/test-landing-page](http://mauticdomain.com/category/test-landing-page)
- [http://otherdomain.com/test-landing-page](http://otherdomain.com/test-landing-page) -\> proxy -\> [http://mauticdomain.com/category/test-landing-page](http://mauticdomain.com/category/test-landing-page)

It seems that all works if folders are all equal:

- [http://otherdomain.com/category/test-landing-page](http://otherdomain.com/category/test-landing-page) -\> proxy -\> [http://mauticdomain.com/category/test-landing-page](http://mauticdomain.com/category/test-landing-page)

This has to be a restriction on the Mautic side… no?

Note that to make it work for landing pages, I also had to create reverse proxy rewrite rules for /form/submit and /themes.
