Skip to content

Commit

Permalink
Fix and update apache config (fixes #312)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlagmichdoch authored Aug 17, 2024
1 parent 3e502a7 commit b34b3f7
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions docs/host-your-own.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,6 @@ a2enmod proxy
a2enmod proxy_http
```

```bash
a2enmod proxy_wstunnel
```

<br>

Create a new configuration file under `/etc/apache2/sites-available` (on Debian)
Expand All @@ -570,33 +566,21 @@ Create a new configuration file under `/etc/apache2/sites-available` (on Debian)

```apacheconf
<VirtualHost *:80>
ProxyPass / http://127.0.0.1:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://127.0.0.1:3000/$1" [P,L]
ProxyPass / http://127.0.0.1:3000/ upgrade=websocket
</VirtualHost>
<VirtualHost *:443>
ProxyPass / https://127.0.0.1:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "wws://127.0.0.1:3000/$1" [P,L]
ProxyPass / https://127.0.0.1:3000/ upgrade=websocket
</VirtualHost>
```

#### Automatic HTTP to HTTPS redirect:

```apacheconf
<VirtualHost *:80>
Redirect permanent / https://127.0.0.1:3000/
Redirect permanent / https://127.0.0.1:3000/
</VirtualHost>
<VirtualHost *:443>
ProxyPass / https://127.0.0.1:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "wws://127.0.0.1:3000/$1" [P,L]
ProxyPass / http://127.0.0.1:3000/ upgrade=websocket
</VirtualHost>
```

Expand Down

0 comments on commit b34b3f7

Please sign in to comment.