HelloZeroNet / HelloZeroNet/ZeroNet

"Connection with UiServer Websocket was lost. Reconnecting..." when using reverse proxy on apache

Open
#1,477 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
18.8k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

### Step 1: Please describe your environment

* ZeroNet version: 0.6.2
* Operating system: Debian 9 Stretch Stable
* Web browser: Firefox
* Tor status: always
* Opened port: no
* Special configuration: remote access and apache reverse proxy

### Step 2: Describe the problem:
I tried to access zeronet installed on my server ( debian 9 and apache) with a domain name and https using a reverse proxy.
but I get the error `! "Connection with UiServer Websocket lost. Reconnecting... "`
If I connect directly with the ip of my server without https then I do not have an error.

From my research i found that some people was having the same problem but were using nginx and solved it by changing the virtual host config.

ex: https://www.reddit.com/r/zeronet/comments/4a0vbb/zeronet_redirect_via_nginx/

I don't want to use nginx if possible, I want to solve the problem with apache.

Someone open an issue on the github t but closed it without any explanation.

https://github.com/HelloZeroNet/ZeroNet/issues/495

#### Steps to reproduce:

I wrote the config for reverse proxy in apache:

```

ServerName zeronet.xxxxxx.com:443
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/zeronet.xxxxxx.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/zeronet.xxxxx.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLHonorCipherOrder on
AllowEncodedSlashes On
SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:43110/ retry=0
ProxyPassReverse / http://127.0.0.1:43110/
ProxyPassReverse /Websocket http://127.0.0.1:43110/
ProxyPassMatch ^/(.*)$ http://127.0.0.1:43110/$1/

Require all granted

```

Zeronet is a systemd service

```
[Unit]
Description= Decentralised websites
After=network-online.target
[Service]
Type=simple
User=serveur
Group=serveur
UMask=007
ExecStart=/ZeroNet-master/zeronet.py --tor always --ui_ip "*" --ui_host zeronet.xxxxxx.com --disable_udp
Restart=on-failure
# Time to wait before forcefully stopped.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
```

Zeronet is running fine and the same for apache.

Then connect to https://zeronet.xxxxxx.com

#### Observed Results:

I can connect and login in zeronet but I don't have any interface and the next warning is showing up:
`
! "Connection with UiServer Websocket lost. Reconnecting... "`

Then nothing happening.

#### Expected Results:

To not have an error and have an interface.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.