exec sudo -u www-data DEBUG_LOG=true nodejs trivabble-server.js
```
-8. Configure your web server.
+8. Configure your web server. In the next two sections, we describe the configuration for Apache 2 and Nginx.
-On Apache 2, the relevant rules are:
+#### Apache 2
+
+On Apache 2, the relevant rules are:
RewriteEngine on
RewriteRule "^/?:trivabble/ws/(.*)" ws://localhost:3000/ws/$1 [P]
a2enmod rewrite
```
-A full example is available in (doc/trivabble-apache-host.conf.sample)[doc/trivabble-apache-host.conf.sample].
-
:warning: Be careful to allow enough concurrent processes / threads / workers on your web server.
Each player requires one long-standing connection (XHR, SSE or WebSocket), plus small requests when not using WebSockets.
+Long-standing connections may cause issues with Apache 2, and using HTTP 2 may lead to "interesting" behavior.
+
+### Nginx
+
+Here is an example of an Nginx configuration for Trivabble:
+
+```
+server {
+ listen 443 ssl http2;
+ listen [::]:443 ssl http2;
+
+ server_name trivabble.example.org;
+
+ location /:trivabble/ws/ {
+ proxy_pass http://127.0.0.1:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "Upgrade";
+ proxy_set_header Host $host;
+ }
+
+ location /:trivabble {
+ proxy_pass http://127.0.0.1:3000;
+ proxy_buffering off;
+ }
+
+ location /trivabble {
+ alias /var/www/html/trivabble-public;
+ }
+
+ # SSL configuration here
+}
+```
## Enable the spell checker