Last active
October 21, 2018 11:01
-
-
Save Dan0sz/ded8baf6454ae0feab71c2be66d9caf6 to your computer and use it in GitHub Desktop.
Nginx Server-block for Reverse Proxy for Plex in OpenMediaVault to place in /etc/nginx/sites-available/.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen [::]:443; | |
server_name plex.mydomain.com; | |
rewrite https://$host$request_uri? permanent; | |
error_log /var/log/nginx/openmediavault-plex_error.log error; | |
access_log /var/log/nginx/openmediavault-plex_access.log combined; | |
ssl on; | |
# These are the paths to your generated Let's Encrypt SSL certificates. | |
ssl_certificate /etc/letsencrypt/live/plex.mydomain.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/plex.mydomain.com/privkey.pem; | |
# To generate your dhparam.pem file, run `openssl dhparam -out /etc/nginx/dhparam.pem 2048` (without the quotes) in your terminal. | |
ssl_dhparam /etc/nginx/dhparam.pem; | |
ssl_session_timeout 1d; | |
ssl_session_cache shared:SSL:60m; | |
location / { | |
# IP address of Plex Media Server | |
proxy_pass http://127.0.0.1:32400; | |
proxy_buffering off; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $http_connection; | |
proxy_cookie_path /web/ /; | |
access_log off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment