# Issue with connection lost on when using apache proxy

**URL:** <https://community.n8n.io/t/issue-with-connection-lost-on-when-using-apache-proxy/30263>\
**Category:** Questions\
**Tags:** deployment\
**Created:** [September 7, 2023, 10:23am UTC](https://community.n8n.io/t/issue-with-connection-lost-on-when-using-apache-proxy/30263 "2023-09-07T10:23:54Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Adriano](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/adriano/32/31570_2.png) [@Adriano](https://community.n8n.io/u/Adriano)\
**Post date:** [November 2, 2023, 6:44am UTC](https://community.n8n.io/t/issue-with-connection-lost-on-when-using-apache-proxy/30263/5 "2023-11-02T06:44:59Z")

</div>

Enable Apache module proxy and proxy\_wstunnel

`sudo a2enmod proxy`

`sudo a2enmod proxy_wstunnel`

edit apache2 conf with the content bellow  
`sudo vi /etc/apache2/sites-available/000-default.conf`

```auto
<VirtualHost *:80>
        ServerName n8n.yourdomain.com
        RewriteEngine on

        ProxyPreserveHost On

        ProxyPass / http://127.0.0.1:5678/
        ProxyPassReverse / http://127.0.0.1:5678/

        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteCond %{HTTP:Connection} upgrade [NC]
        RewriteRule ^/?(.*) "ws://127.0.0.1:5678/$1" [P,L]

</VirtualHost>

```

Restart apache2  
`sudo systemctl restart apache2`

---

_[View the full topic](https://community.n8n.io/t/issue-with-connection-lost-on-when-using-apache-proxy/30263)._
