Jump to content
linuxserver.io

[Support] Linuxserver.io - Letsencrypt (Nginx)

2809 posts in this topic Last Reply

Recommended Posts

1 hour ago, Gobs said:

The plex.subdomain.conf:


# make sure that your dns has a cname set for plex, if plex is running in bridge mode, the below config should work as is, for host mode,
# replace the line "proxy_pass https://$upstream_plex:32400;" with "proxy_pass https://HOSTIP:32400;" HOSTIP being the IP address of plex
# in plex server settings, under network, fill in "Custom server access URLs" with your domain (ie. "https://plex.yourdomain.url:443")

server {
    listen 443 ssl;

    server_name plex.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;
    proxy_redirect off;
    proxy_buffering off;
    
    # enable for ldap auth, fill in ldap details in ldap.conf 
    #include /config/nginx/ldap.conf;


    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_plex plex;
        proxy_pass https://$upstream_plex:32400;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
        proxy_set_header X-Plex-Device $http_x_plex_device;
        proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
        proxy_set_header X-Plex-Platform $http_x_plex_platform;
        proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
        proxy_set_header X-Plex-Product $http_x_plex_product;
        proxy_set_header X-Plex-Token $http_x_plex_token;
        proxy_set_header X-Plex-Version $http_x_plex_version;
        proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
        proxy_set_header X-Plex-Provides $http_x_plex_provides;
        proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
        proxy_set_header X-Plex-Model $http_x_plex_model;
    }
}

Nginx is listening to port 180 and 1443, since ports 80 and 443 are forwarded on my router to 180 and 1443. Both nginx and plex are running on a custom network in bridge mode.

Is your Plex container name "plex"?

Share this post


Link to post
16 hours ago, aptalca said:

Is your Plex container name "plex"?

It is. Nginx log is shown below as well. In the Nginx log I saw this:

[cont-init.d] 50-config: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Server ready
Signal handled: Terminated.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

But again, nextcloud works while plex doesn't which is weird.

Share this post


Link to post
13 minutes ago, Gobs said:

It is. Nginx log is shown below as well. In the Nginx log I saw this:


[cont-init.d] 50-config: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Server ready
Signal handled: Terminated.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

But again, nextcloud works while plex doesn't which is weird.

Is Plex all set up and running?

 

Also that's not the nginx log. That's part of a docker log of a container

Share this post


Link to post
3 hours ago, aptalca said:

Is Plex all set up and running?

 

Also that's not the nginx log. That's part of a docker log of a container

Yes, as in if I go to http://SERVER_IP:32400/web/index.html# I am greeted with a sign in page. I sign in and then Plex looks for servers but to no avail.

Share this post


Link to post
28 minutes ago, Gobs said:

Yes, as in if I go to http://SERVER_IP:32400/web/index.html# I am greeted with a sign in page. I sign in and then Plex looks for servers but to no avail.

Well there is your issue. Plex was never set up. You didn't claim your server. Until then it will block reverse proxy connections.

Share this post


Link to post

An issue I've had for the past 2 weeks. I've been able to open port 80 (TCP) on my router. (Confirmed on http://canyouseeme.org/.

I've followed SpaceIndaver's instructions, and created the docker, however I'm getting a 404 error:

 

Failed authorization procedure. myserver.duckdns.org (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://myserver.duckdns.org/.well-known/acme-challenge/BPoI7fI9FIgfwZoIV_JSMFBjr1a8u1K5ATulxHV3gXQ: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>"

 

This seems like it's accessing a website, but returning a 404?

Share this post


Link to post
23 hours ago, aptalca said:

Well there is your issue. Plex was never set up. You didn't claim your server. Until then it will block reverse proxy connections.

Except I can't set it up since if I go to http://SERVER_IP:32400/web/index.html# and sign in Plex cannot find any servers.

 

EDIT: I think this is an issue with Plex. The account that originally claimed the server was deleted, but it would appear that it's still in the Plex database somehow since I cannot create an account with the same email address. I assume then that Plex still considers the server to be claimed by that account, and so won't let any other account claim it.

Edited by Gobs

Share this post


Link to post
16 hours ago, Tebasaki said:

An issue I've had for the past 2 weeks. I've been able to open port 80 (TCP) on my router. (Confirmed on http://canyouseeme.org/.

I've followed SpaceIndaver's instructions, and created the docker, however I'm getting a 404 error:

 

Failed authorization procedure. myserver.duckdns.org (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://myserver.duckdns.org/.well-known/acme-challenge/BPoI7fI9FIgfwZoIV_JSMFBjr1a8u1K5ATulxHV3gXQ: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>"

 

This seems like it's accessing a website, but returning a 404?

I believe your port 80 is forwarded to your unraid gui at the moment

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now