# Bolt behind Apache reverse proxy, is it even possible?

**URL:** <https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819>\
**Category:** Server\
**Created:** [March 17, 2019, 5:09pm UTC](https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819 "2019-03-17T17:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco\_brandizi](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/marco_brandizi/32/3732_2.png) [@marco\_brandizi](https://community.neo4j.com/u/marco_brandizi)\
**Post date:** [March 17, 2019, 5:09pm UTC](https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819/1 "2019-03-17T17:09:53Z")

</div>

Hi all,

I'm having hard time trying to publish my Neo4j server as a public HTTP endpoint. I'm familiar with Apache configuration and basic TCP/IP, but not so expert on reverse proxy configuration.

Sorry, I've to continue my message here: [neo4j-rev-proxy.md · GitHub](https://gist.github.com/marco-brandizi/6a8c0194bf19077b5ff6db3d2d752b2c), due to the 5 URL limitation in this hereby forum.

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [March 17, 2019, 5:25pm UTC](https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819/2 "2019-03-17T17:25:27Z")

</div>

Bolt isn't HTTP, and hence it isn't possible to proxy bolt using an HTTP proxy. HTTP is what's called a layer 7 application protocol, and the proxy is probably assuming that the data coming across the wire will be a certain way, because it's HTTP. But the data will never come that way, because it's a different layer 7 protocol (bolt, not http).

Now, you can proxy bolt -- you just can't do it via HTTP.

The docs have setup on how to do this with HAProxy, right here: [Clustering - Operations Manual](https://neo4j.com/docs/operations-manual/current/ha-cluster/haproxy/#ha-haproxy-bolt)

I'm not sure how to do it with Apache as a reverse proxy just because I've never tried, but if you want to give it a shot, try to proxy bolt as a TCP connection, not HTTP.

Finally -- proxying bolt will only work if what you're proxying is a single node. If you have a cluster, then Neo4j bolt+routing drivers operate in a way that might make proxying difficult. You can skip this if you're not using a cluster, but full details on that can be found here: [Querying Neo4j Clusters. How Neo4j clusters and smart query… | by David Allen | Neo4j Developer Blog | Medium](https://medium.com/neo4j/querying-neo4j-clusters-7d6fde75b5b4)

---

<div class="post-metadata">

**Author:** ![marco\_brandizi](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/marco_brandizi/32/3732_2.png) [@marco\_brandizi](https://community.neo4j.com/u/marco_brandizi)\
**Post date:** [March 18, 2019, 10:10am UTC](https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819/3 "2019-03-18T10:10:50Z")

</div>

Hi @david_allen,

thank you very much for your reply. It seems we have Apache and it doesn't support generic TCP connections. It [supports websockets](https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html) though, but it seems it requires URLs beginning with ws:// . If I get it well, making the Neo4j drivers able to understand that prefix could be a possible improvement on your side.

Best,  
Marco.

---

<div class="post-metadata">

**Author:** ![bitsofinfo](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bitsofinfo/32/15498_2.png) [@bitsofinfo](https://community.neo4j.com/u/bitsofinfo)\
**Post date:** [December 13, 2020, 11:19pm UTC](https://community.neo4j.com/t/bolt-behind-apache-reverse-proxy-is-it-even-possible/5819/4 "2020-12-13T23:19:09Z")

</div>

@david_allen trying to find that haproxy doc in the docs, I can only find it for 3.5 and it says deprecated?
