Search the Community
Showing results for tags 'example'.
Cloudflare and emby Config Version 1.0.0 Last Update 02-25-2022 Update by Pir8Radio ** UPDATE: I AM HEARING OF EMBY USERS GETTING VIDEO FILES BLOCKED WHEN USING CLOUDFLARE (FREE TIER). IF THIS IS THE CASE, I NO LONGER RECOMMEND USING CLOUDFLARE. Even with the cache bypass rules, your video still passes through their system and is technically against their TOS. Use CloudFlare at your own risk if you choose to continue. I'll update if I get more info. Please post in this thread if you find you have video loading/playing/downloading issues while using cloudflare or have received an email from them about this. MESSAGE FROM CLOUDFLARE: Free, Pro, and Business Plans serving videos or a disproportionate amount of non-HTML content can be in violation of Section 2.8 of the Self-Serve Subscription Agreement (TOS). This will turn into a full Cloudflare how-to. Others are welcome to edit this or PM me with suggestions.. However right now I'm just going to post some recommended settings for people who already have Cloudflare setup. There are a few cloudflare settings that break emby, some break it in obvious ways, some only certain apps in certain situations.. These are the settings I found that work well as of today. I'll try to maintain this post and update the header info should new features come out, or the community discovers better settings than these. As of today, these are the settings available to us in Cloudflare FREE account: First disable the two main things that will break emby, go to the "Speed" tab then "Optimization" sub-tab. DISABLE Auto Minify and Rocket Loader! (screen shots are in the recommended state) Other options on this settings page are optional to enable, I suggest enabling Brotli compression. It's a good thing. Now head over to the "Caching" tab and select the "Configuration" sub-tab. Set your Caching settings as shown below. THIS IS OPTIONAL: Other settings in this settings tab are optional to whatever you like.. I have "Always Online" enabled, its kind of a neat feature that caches as much of your emby server as it can in case your server is down, users will at least see an emby splash screen, that's usually about it.. but its something... kind of useless otherwise.. Handy if you have other websites, it will totally cache normal html websites and users can continue to use your cached site when you have a web server outage. Next head over to the "Rules" tab. Create these two rules: Rule #2 here we will bypass caching 99% of all video. Caching the video will actually slow down the client experience. It screws with the chunks and often times has to fully cache 1 chunk before cloudflare sends it to the client, causing playback delays. Rule #3 here will cache all images on the edge servers for 30 days. We need this rule, because cloudflare only caches known file urls, like picture.jpg or poster.png emby serves up webp images with NO EXTENSION so cloudflare doesn't know to cache these items. But 99% of emby images come from the /items/XXXXXX/images directory so we will just force cache everything that comes from this URL, it should be only images. Keep in mind when you enable this it can take some time to build up cache.. emby serves up different sized images based on browser screen size, apps, etc.. so if you load a page that is minimized to a small window on your desktop emby will serve smaller sized images, if you make your browser full screen, now emby will serve up larger images and those images may load slow the first few times until they get cached too. Go below this screenshot and I'll show you how to check if caching is working. Check to see if Cloudflare Caching is working Well, how do you know Cloudflare is doing its thang'? Use a browser like chrome, or the new Microsoft edge (which is just a rebranded chrome). Open the browser, right click in the browser window and go down to "Inspect" (there is an F key for this too I forget what it is, I should add that here lol). Once the dev window pops up adjust it so you have a good view on the right, click the "Network" tab, hit the reload button on whatever page you are on so some info populates on the right dev screen. You should see something similar to this: Right click on the table header (Name, Method, Status, Protocol) anywhere, just right click the "Name" one. Go down to "Response Headers" then "Manage Header Columns". A little window will pop up hit "Add custom header..." and then add this header: cf-cache-status Now select the little sub tab that says "all" now surf your way to your emby server, and you should see something like the below screenshot. Hit is well..... a hit! this image came from cloudflare and was never requested from your emby server, saving you from sending this image to the client, saving time and bandwidth. MISS is also kind of obvious, it was a miss, either due to never being cached yet (first time Cloudflare has seen this image or document) if you hit refresh a few times, cloudflare will then cache it and it will turn to HIT. BYPASS I'm actually not sure why my server is returning server 500 errors below, this image is being called for by emby clients but the server has no image to serve, but usually you should only see BYPASS on playing video's if your rules above are correct. Or in my case, a server error will not be cached. DYNAMIC this is also a NO HIT response.. this is usually due to Cloudflare knowing this resource changes a lot and doesn't want to cache it so your clients don't get served stale data, or its a video, websocket, or some other format Cloudfare's great automated intelligence deems it should not be cached. That is the basics that will save you a lot of headache and blaming emby for things not working.. There are lots of cool options to enable outside of these basic settings above, ask questions here, send ideas that maybe I have missed that work great for you.. I just wanted to throw this up due to a lot more of you guys using Cloudflare. In the end you should start to see more "HIT" responses... and a noticeably faster loading time for the clients, less bandwidth usage for your emby server, and everyone is happy.. Well..... within reason....
Hi everyone, I would like to share my setup since it might be helpful to someone, and I can also offer advice to those who are stuck trying to do the same thing. I am a Windows certified system engineer for 14 years. I chose Esxi and Ubuntu server because it is very stable and low maintenance. I hope this post is allowed, if not feel free to lock/delete my post. Hardware Synology DS920+ (iscsi LUN datastore for VMWare) Lenovo Tiny M720q (Intel i5-8400T, 16GB RAM, VMWare Esxi 7.0.2) Lenovo Tiny P330 (Intel i5-9700T, 32GB RAM, Nvidia Quadro P620, VMWare Esxi 7.0.2) Software Virtual Machine "VM-Emby" Ubuntu 20.04.3 LTS (4 cores, 8GB RAM, 20GB HDD) Setup I won't go into detail on everything since there are already some great guides out there: - Configure iscsi on Synology: https://vmspot.com/synology-iscsi-for-vmware-vsphere/ - Install Ubuntu on VMWare Esxi: https://blog.eldernode.com/install-ubuntu-20-04-lts-server-on-vmware/ - Install Emby: https://emby.media/linux-server.html (use the wget command to download the file. So for example "sudo wget https://github.com/MediaBrowser/Emby.Releases/releases/download/22.214.171.124/emby-server-deb_126.96.36.199_amd64.deb" GPU Passthrough 1. In VMWare Esxi go to Host -> Manage and open the Hardware tab. Select your GPU in the list of PCI devices and make sure passtrough is set to Active. If this is not the case you can click the Toggle passtrough button. 2. Make sure your Emby VM is turned off, and edit the settings. (Actions -> Edit settings) 3. Click Add another device -> PCI device and add both the GPU and the Audio controller that comes with it. 4. Go to the VM Options tab -> Advanced and click on the Edit configuration button. 5. Add a new parameter to the list: hypervisor.cpuid.v0 with the value FALSE 6. Boot the VM and install the GPU drivers. In my case I used the default Nvidia package by using the command sudo apt install nvidia-driver-440 7. You can verify it was installed correctly by using the command nvidia-smi (If you open a stream on Emby that uses transcoding you will also see the memory it is using with this command). 8. If you start playing a movie you can see in your Emby admin dashboard that hardware transcoding is being used. If it says software->software you're not quite there yet. Updates and maintenance I log into the Ubuntu server every month or 2 to install the OS updates, or whenever Emby has a new release. Ubuntu OS update: 1. Log in to the VM (SSH via Putty, through the Esxi admin portal, ...) 2. Type the command sudo apt full-upgrade and confirm with Y 3. I always reboot my VM after installing updates with the sudo reboot command, but you do you. This depends on the updates but is usually not required. Emby server update: 1. Your Emby admin dashboard will show you when there is a new update. 2. Log in to the VM (I recommend Putty here since you can copy paste the URL) 3. Open the Emby website https://emby.media/linux-server.html 4. Right click the version you need and select copy link address 5. In your VM type the command sudo wget [link address] so for example: sudo wget https://github.com/MediaBrowser/Emby.Releases/releases/download/188.8.131.52/emby-server-deb_184.108.40.206_amd64.deb 6. Copy the command from rule nr2 on the Emby website, in this case its dpkg -i emby-server-deb-220.127.116.11_amd64.deb 7. reboot the server with sudo reboot