From de9c0ef0344f3e35489205bca063a4416c3bdac3 Mon Sep 17 00:00:00 2001 From: JRC <58901318+jarrodCoombes@users.noreply.github.com> Date: Sat, 23 Oct 2021 17:12:32 -0700 Subject: [PATCH 1/2] Updated the readme to include the nginx settings --- readme.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e2a879f3..1cadb928 100644 --- a/readme.md +++ b/readme.md @@ -117,6 +117,42 @@ cd audiobookshelf npm run prod -- -p [PORT] --audiobooks [AUDIOBOOKS_PATH] --config [CONFIG_PATH] --metadata [METADATA_PATH] ``` +### nginx Reverse Proxy + +Add this to the site config file on your nginx server after you have changed the relevant parts in the <> brackets, and inserted the path to you certificates. + + +```bash + server +{ + + listen 443 ssl; + server_name ..; + + 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 $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_http_version 1.1; + + proxy_pass http://; + proxy_redirect http:// https://; + } +} + + + + + ## Contributing -Feel free to help out \ No newline at end of file +Feel free to help out From 80f8a784c8946d51bb843f1bca23e2b1f9c8838d Mon Sep 17 00:00:00 2001 From: JRC <58901318+jarrodCoombes@users.noreply.github.com> Date: Sat, 23 Oct 2021 17:13:29 -0700 Subject: [PATCH 2/2] Fixed minor formatting issue. --- readme.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 1cadb928..e42e6938 100644 --- a/readme.md +++ b/readme.md @@ -123,9 +123,8 @@ Add this to the site config file on your nginx server after you have changed the ```bash - server +server { - listen 443 ssl; server_name ..; @@ -148,9 +147,7 @@ Add this to the site config file on your nginx server after you have changed the proxy_redirect http:// https://; } } - - - +``` ## Contributing