You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was having trouble getting websocket support up and running behind an Apache reverse proxy without Docker after the /audiobookshelf subdirectory update, since the >= 2.4.47 Apache directives weren't working for me (I'm on Apache v2.4.29 if that matters). After some troubleshooting and checking out the logs to see what the websocket was actually connecting to, I discovered that setting up a separate Location block for the socket.io websocket subdirectory worked properly. Not sure if this will work for everybody, but it might help people with my usecase, since it works with all the *arr and plex reverse proxies I had set up already, and also works behind the port 443 virtualhost for SSL support.
SSLProxyEngine on
<Location /audiobookshelf>
ProxyPreserveHost on
ProxyPass http://localhost:13378/audiobookshelf
ProxyPassReverse http://localhost:13378/audiobookshelf
</Location>
<Location /audiobookshelf/socket.io>
ProxyPreserveHost on
ProxyPass ws://localhost:13378/audiobookshelf/socket.io upgrade=websocket
ProxyPassReverse ws://localhost:13378/audiobookshelf/socket.io
</Location>
If a full example helps anyone, here's a trimmed down version of a full virtualhost definition with LetsEncrypt certificates via certbot, for plex and related services for AudioBookShelf/Readarr/Jackett.
<VirtualHost [CENSORED_INTERNAL_IP]:443>
ServerAdmin webmaster@localhost
ServerName [CENSORED_DOMAIN_NAME]
ProxyRequests Off
ProxyPreserveHost On
# Plex Proxy
ProxyPass /plex http://localhost:32400
ProxyPassReverse /plex http://localhost:32400
ProxyPass /web http://localhost:32400/web
ProxyPassReverse /web http://localhost:32400/web
# Plex Websocket proxy
SSLProxyEngine on
<Location /plex:/websockets/notifications>
ProxyPass wss://localhost:32400/:/websockets/notifications
ProxyPassReverse wss://localhost:32400/:/websockets/notifications
</Location>
# Sonarr Proxy
RewriteEngine on
RewriteRule ^/admin/sonarr$ /admin/sonarr/ [R]
<Location /admin/sonarr>
ProxyPass http://localhost:8989/admin/sonarr
ProxyPassReverse http://localhost:8989/admin/sonarr
Header add X-Frame-Options "SAMEORIGIN"
</Location>
# Radarr Proxy
RewriteEngine on
RewriteRule ^/admin/radarr$ /admin/radarr/ [R]
<Location /admin/radarr>
ProxyPass http://localhost:7878/admin/radarr
ProxyPassReverse http://localhost:7878/admin/radarr
Header add X-Frame-Options "SAMEORIGIN"
</Location>
# Readarr Proxy
RewriteEngine on
RewriteRule ^/admin/readarr$ /admin/readarr/ [R]
<Location /admin/readarr>
ProxyPass http://localhost:8787/admin/readarr
ProxyPassReverse http://localhost:8787/admin/readarr
Header add X-Frame-Options "SAMEORIGIN"
</Location>
# AudioBookShelf Proxy
# Enable SSLProxyEngine if it's not already turned on for other services in your virtualhost definition
#SSLProxyEngine on
RewriteRule ^/audiobookshelf$ /audiobookshelf/ [R]
<Location /audiobookshelf>
ProxyPreserveHost on
ProxyPass http://localhost:13378/audiobookshelf
ProxyPassReverse http://localhost:13378/audiobookshelf
</Location>
<Location /audiobookshelf/socket.io>
ProxyPreserveHost on
ProxyPass ws://localhost:13378/audiobookshelf/socket.io upgrade=websocket
ProxyPassReverse ws://localhost:13378/audiobookshelf/socket.io
</Location>
# Jackett Proxy
RewriteEngine on
RewriteRule ^/admin/jackett$ /admin/jackett/ [R]
<Location /admin/jackett>
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
ProxyPass http://localhost:9117/admin/jackett
ProxyPassReverse http://localhost:9117/admin/jackett
</Location>
# Enable LetsEncrypt SSL support
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/[CENSORED_DOMAIN_NAME]/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/[CENSORED_DOMAIN_NAME]/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
# Force SSL headers at all times (completely disables http)
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
#Header always unset X-Frame-Options
</IfModule>
</VirtualHost>
Why would this be helpful?
Ideally this will help people configure a manual Apache2 reverse proxy (I wasn't able to find any related issues or working documentation for getting this set up manually).
Future Implementation (Screenshot)
Maybe we can add this snippet to the readme under the Apache Reverse Proxy config instructions section!
Audiobookshelf Server Version
v2.19.0
Current Implementation (Screenshot)
No response
The text was updated successfully, but these errors were encountered:
I should clarify, this was my first time installing (I was waiting on subdirectory support). I'm not sure if it worked in previous versions or not.
I tried with the /audiobookshelf subdir removed (I tried both examples in the readme), and neither of them worked out for me, removing the /audiobookshelf subdir just gave me a 404. The dashboard/webapp loaded fine (other than the socket error popup in the dashboard), but websockets weren't working until I specifically added the socket.io location block (which I did because the console error was pinging the server address/audiobookshelf/socket.io/[query strings]. Maybe someone who knows a bit more about apache2 can pitch in, I'm definitely not an expert.
Type of Enhancement
Documentation
Describe the Feature/Enhancement
I was having trouble getting websocket support up and running behind an Apache reverse proxy without Docker after the /audiobookshelf subdirectory update, since the >= 2.4.47 Apache directives weren't working for me (I'm on Apache v2.4.29 if that matters). After some troubleshooting and checking out the logs to see what the websocket was actually connecting to, I discovered that setting up a separate Location block for the socket.io websocket subdirectory worked properly. Not sure if this will work for everybody, but it might help people with my usecase, since it works with all the *arr and plex reverse proxies I had set up already, and also works behind the port 443 virtualhost for SSL support.
If a full example helps anyone, here's a trimmed down version of a full virtualhost definition with LetsEncrypt certificates via certbot, for plex and related services for AudioBookShelf/Readarr/Jackett.
Why would this be helpful?
Ideally this will help people configure a manual Apache2 reverse proxy (I wasn't able to find any related issues or working documentation for getting this set up manually).
Future Implementation (Screenshot)
Maybe we can add this snippet to the readme under the Apache Reverse Proxy config instructions section!
Audiobookshelf Server Version
v2.19.0
Current Implementation (Screenshot)
No response
The text was updated successfully, but these errors were encountered: