-
-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is this a new feature request?
- I have searched the existing issues
Wanted change
I've checked and noticed that there is no reverse proxy configuration for Storyteller (subdomain or subfolder).
Reason for change
I'd rather use a reverse proxy than open up ports.
Proposed code change
`## Version 2025/01/21
make sure that your storyteller container is named storyteller
make sure that your dns has a cname set for storyteller
server {
listen 443 ssl;
#listen 443 quic;
listen [::]:443 ssl;
#listen [::]:443 quic;
server_name storyteller.*;
include /config/nginx/ssl.conf;
# Storyteller requires large file uploads for audiobook files (10GB)
# Note: client_max_body_size 0 is already set globally in nginx.conf
# but we keep this here for documentation purposes if nginx.conf changes
client_max_body_size 0;
# enable for ldap auth (requires ldap-location.conf in the location block)
#include /config/nginx/ldap-server.conf;
# enable for Authelia (requires authelia-server.conf in the location block)
#include /config/nginx/authelia-server.conf;
# enable for Authentik (requires authentik-location.conf in the location block)
#include /config/nginx/authentik-server.conf;
# enable for Tinyauth (requires tinyauth-location.conf in the location block)
#include /config/nginx/tinyauth-server.conf;
# WebSocket support for real-time updates (book events, progress sync)
# This fixes the "Firefox can't establish a connection to the server at
# https://storyteller.sickcouch.com/api/v2/books/events" error
location /api/v2/books/events {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app storyteller;
set $upstream_port 8001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
# NextJS static assets with proper caching
# This helps prevent the font preload warnings by ensuring proper cache behavior
location ~* ^/_next/static/ {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app storyteller;
set $upstream_port 8001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Cache static assets for 1 year (these have content hashes in filenames)
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Book content and fonts (served from API)
location ~* ^/api/v2/books/.+/(read|cover)/ {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app storyteller;
set $upstream_port 8001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Allow CORS for fonts and book content to prevent font loading issues
add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
add_header Access-Control-Allow-Headers "Range, Content-Type" always;
# Cache book content for 1 week (books don't change often)
add_header Cache-Control "public, max-age=604800";
# Enable range requests for streaming audio/large files
proxy_force_ranges on;
}
# Main location block
location / {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable for ldap auth (requires ldap-server.conf in the server block)
#include /config/nginx/ldap-location.conf;
# enable for Authelia (requires authelia-server.conf in the server block)
#include /config/nginx/authelia-location.conf;
# enable for Authentik (requires authentik-server.conf in the server block)
#include /config/nginx/authentik-location.conf;
# enable for Tinyauth (requires tinyauth-server.conf in the server block)
#include /config/nginx/tinyauth-location.conf;
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app storyteller;
set $upstream_port 8001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Enable range requests for streaming (important for audiobooks)
# Note: proxy.conf already handles most headers including WebSocket upgrade
proxy_force_ranges on;
}
}
`
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Issues