Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting and adjusting Nginx docs #1098

Merged
merged 21 commits into from
Sep 11, 2024
Merged

Correcting and adjusting Nginx docs #1098

merged 21 commits into from
Sep 11, 2024

Conversation

solidsnake1298
Copy link
Member

@solidsnake1298 solidsnake1298 commented Sep 5, 2024

Correcting and adjusting Nginx docs. Jellyfin site config should not be in conf.d. Also making adjustments to config to address common problems. Particularly with the COOP/COEP headers causing image searching to not show images.

@solidsnake1298
Copy link
Member Author

Still testing to validate function vs security.

@solidsnake1298
Copy link
Member Author

@felix920506 @thornbill

What are your opinions on the way we currently have the http vs https configs laid out? Right now we have an http config with https parameters commented out. But we also have a separate https example.

Should we de-clutter the http example in favor of the already separate https example?

@felix920506
Copy link
Member

We should have the default be https, and tell them to comment / change certain lines if they wish to have a http only setup.

@solidsnake1298
Copy link
Member Author

We should have the default be https, and tell them to comment / change certain lines if they wish to have a http only setup.

Done. Put HTTPS prominently at the top. HTTP example is tucked away in an expandable block.

Why would the subpath examples not proxy /socket?

@solidsnake1298 solidsnake1298 marked this pull request as ready for review September 5, 2024 21:36
@felix920506
Copy link
Member

why isn't the https one default for the subpath option?

@solidsnake1298
Copy link
Member Author

why isn't the https one default for the subpath option?

Re-arranged.

Copy link
Member

@felix920506 felix920506 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things.

  1. Please help cut down on admonitions if they aren't absolutely necessary
  2. Why does the subdomain config have many more security options than the subpath config?

@solidsnake1298
Copy link
Member Author

  1. Please help cut down on admonitions if they aren't absolutely necessary

I do agree it is excessive. I will trim and tone down the warnings.

  1. Why does the subdomain config have many more security options than the subpath config?

My bad. Will make it uniform.

@solidsnake1298
Copy link
Member Author

solidsnake1298 commented Sep 6, 2024

@felix920506

  1. Please help cut down on admonitions if they aren't absolutely necessary

I removed one of the cautions and changed the remaining caution to a tip and changed it a bit to tone it down.

  1. Why does the subdomain config have many more security options than the subpath config?

Done. Also uncommented the CSP header and added img-src to address an issue not having it causes when searching for images in the Jellyfin UI.

Copy link
Member

@felix920506 felix920506 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that some parts of the guide use example.org as an example domain, while others use DOMAIN.TLD, can we change them all to be uniform?

Comment on lines 12 to 16
:::tip

The default X-Frame-Options header may cause issues with the webOS app, causing it to remain stuck at a black screen. If enabled, the default Content Security Policy may also cause issues.

:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A caution is more appropriate for this one but realistically it can be removed altogether IMO, there is already mentions about it in the comments in the config

server {
listen 80;
listen [::]:80;
# server_name DOMAIN_NAME;
server_name jellyfin.DOMAIN.TLD;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe using example.com would be better than DOMAIN.TLD? Also add text to tell users to replace the example domain with what they actually want

# listen [::]:443 ssl;
http2 on;
server_name DOMAIN_NAME;
server_name jellyfin.DOMAIN.TLD;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Comment on lines 52 to 56
ssl_certificate /etc/letsencrypt/live/DOMAIN.TLD/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN.TLD/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
ssl_trusted_certificate /etc/letsencrypt/live/DOMAIN.TLD/chain.pem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above (example.com instead of DOMAIN.TLD)

# Content Security Policy
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
# Enforces https content and restricts JS/CSS to origin
# External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
# NOTE: The default CSP headers may cause issues with the webOS app
#add_header Content-Security-Policy "default-src https: data: blob: http://image.tmdb.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the gstatic.com and youtube.com policies needed here?

Comment on lines 112 to 116
:::tip

The following configuration is provided for ease of use only. If you are planning on exposing your server over the Internet you should setup HTTPS. [Let's Encrypt](https://letsencrypt.org/getting-started/) can provide free TLS certificates which can be installed easily via [certbot](https://certbot.eff.org/). Using only HTTP will expose passwords and API keys.

:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove admonition please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire thing or just the first sentence?

# Enforces https content and restricts JS/CSS to origin
# External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
# NOTE: The default CSP headers may cause issues with the webOS app
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

server {
listen 80;
listen [::]:80;
server_name jellyfin.DOMAIN.TLD;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

@Gauvino Gauvino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo change 🫡

docs/general/networking/nginx.md Outdated Show resolved Hide resolved
docs/general/networking/nginx.md Show resolved Hide resolved
docs/general/networking/nginx.md Show resolved Hide resolved
docs/general/networking/nginx.md Outdated Show resolved Hide resolved
docs/general/networking/nginx.md Outdated Show resolved Hide resolved
docs/general/networking/nginx.md Outdated Show resolved Hide resolved
docs/general/networking/nginx.md Outdated Show resolved Hide resolved
@jellyfin-bot
Copy link

Cloudflare Pages deployment

Latest commit 10eedc52b10d2a0fa80cba2137fca1a671c3bf65
Status ✅ Deployed!
Preview URL https://2cafafdb.jellyfin-org.pages.dev
Type 🔀 Preview

@solidsnake1298 solidsnake1298 merged commit 6712644 into master Sep 11, 2024
8 checks passed
@solidsnake1298 solidsnake1298 deleted the tdp-nginx-conf branch September 11, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants