Tom

Tom

plex enables https

Import certificates through Plex settings to enable HTTPS access without using nginx for reverse proxy.

1. Prepare the certificate#

I obtained my certificate using the acme method, which I have detailed in a previous article. You can refer to it at https://tyuans.com/linux%e4%bd%bf%e7%94%a8acme%e7%94%b3%e8%af%b7%e8%af%81%e4%b9%a6/

2. Convert the certificate#

Plex requires a .pfx file for adding certificates, but acme generates .key and .cer files. Therefore, we need to convert them using the openssl command.

3. Copy the certificate to the folder where Plex can find it#

Since my Plex server is set up using Docker, the directory is mapped. You can refer to the detailed setup method at https://tyuans.com/docker%e5%ae%89%e8%a3%85plex/

Copy the pfx file to the mapped /video directory in the container. In my case, it is /usr/plex/video.

After copying, go to any library, click Edit, and Add Folder. You can select the path and see that the certificate appears under /video.

4. Plex settings#

Go to Settings, then Network, and under Advanced Options:

5. Script update#

The certificate needs to be renewed every 3 months. We need to write a script to convert and copy the renewed certificate to the Plex mapped folder at regular intervals. Remember to change the absolute path.

Combine the conversion and copy commands from earlier, set up a cron job, and schedule it based on the certificate application time. In my case, I execute it on the 1st of every month. If you're not familiar with cron jobs, you can use an online website to calculate the schedule. https://tool.lu/crontab/

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.