Skip to main content

NGINX

info
  • Please join the Discord server before reporting an issue with your reverse proxy setup on GitHub.
  • Audiobookshelf requires a websocket connection.
  • Using a subfolder is supported with no additional changes but the path must be /audiobookshelf (this is not changeable). See discussion
  • Why do I need to set up my own remote access?

Add this to your NGINX site config after changing the relevant parts in the < > brackets and inserting your certificate paths.

server {
listen 443 ssl;
server_name <sub>.<domain>.<tld>;

access_log /var/log/nginx/audiobookshelf.access.log;
error_log /var/log/nginx/audiobookshelf.error.log;

ssl_certificate /path/to/certificate;
ssl_certificate_key /path/to/key;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

proxy_http_version 1.1;

proxy_pass http://<URL_to_forward_to>;
proxy_redirect http:// https://;

# Prevent 413 Request Entity Too Large error
client_max_body_size 10240M;
}
}