Jump to content

Cannot access emby through reverse proxy after moving to docker


paulmorabi
Go to solution Solved by mastrmind11,

Recommended Posts

paulmorabi

Hi,

 

I'm running Ubuntu 18.04 and was previously running Emby server. I've migrated across to using the docker image. It was actually very straightforward as I pointed /config to the existing config on my system. I have only one issue and that is the nginx reverse proxy is not working anymore. All I get is "Forbidden".

 

This is my nginx config:

 

location /emby {

    auth_basic off;

    proxy_pass http://127.0.0.1:8096; # Local emby ip and non SSL port

 

    proxy_hide_header X-Powered-By;

    proxy_set_header Range $http_range;

    proxy_set_header If-Range $http_if_range;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header Host $host;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 

    #Next three lines allow websockets

    proxy_http_version 1.1;

    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection "upgrade";

    }

 

this is my docker compose config for emby:

 

 

  emby:

    container_name: embyserver

    image: emby/embyserver

    restart: always

    volumes:

      - /var/lib/emby/:/config

      - /media:/media

    ports:

      - 8096:8096

      - 8920:8920

      - 7359:7359/udp

      - 1900:1900/udp

    environment:

      - APP_UID=1000

      - APP_GID=996

      - TZ=${TZ}

      - GIDLIST=44

 

access.log for nginx is showing:

 

 

14.xx.xxx.xxxx - paul [31/Jul/2018:13:02:47 +0900] "GET /emby/web/home.html HTTP/2.0" 403 9 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"

14.xx.xxx.xxxx- paul [31/Jul/2018:13:02:48 +0900] "GET /emby/web/serviceworker.js HTTP/2.0" 403 9 "https://xxxxxxx.duckdns.org/emby/web/serviceworker.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

 

 

Emby server logs don't record any activity so I thought it's possibly a network issue so I tried to change the IP address to the one docker generates (172.xx.xx.xx) and the local LAN address also (192.168.x.x). Neither of these work either even though I can access emby server on these all fine.

 

Any ideas on where I could troubleshoot or how to fix this?

 

Thanks!

 

 

Link to comment
Share on other sites

paulmorabi

Very strangely, when on my home network I can access emby via external address so something definitely very odd.

Link to comment
Share on other sites

  • Solution
mastrmind11

What happens if you switch your docker container to host mode?

  • Like 1
Link to comment
Share on other sites

pir8radio
location /emby {

    auth_basic off;

    proxy_pass http://127.0.0.1:8096; # Local emby ip and non SSL port

loose the emby in /emby    and is your emby server on the same docker as nginx?   you have 127.0.0.1 as your emby server address.

Link to comment
Share on other sites

paulmorabi

Thanks for the replies. So, I've managed to fix this, actually I found two ways to do so:

 

1. Using bridge networking, you need to allow external connections. But using bridge networking also was an issue for Kodi on my home network because it was trying to connect via 172.x.x.x instead of 192.168.x.x.

2. Use host networking. This fixed it.Thanks @@mastrmind11.

Edited by paulmorabi
  • Like 2
Link to comment
Share on other sites

pir8radio

Thanks for the replies. So, I've managed to fix this, actually I found two ways to do so:

 

1. Using bridge networking, you need to allow external connections. But using bridge networking also was an issue for Kodi on my home network because it was trying to connect via 172.x.x.x instead of 192.168.x.x.

2. Use host networking. This fixed it.Thanks @@mastrmind11.

 

Curious that everything (websockets) is working with /emby as the location.  well as i'm sure you already have, but disregard my previous post lol.   

Edited by pir8radio
Link to comment
Share on other sites

paulmorabi

Curious that everything (websockets) is working with /emby as the location.  well as i'm sure you already have, but disregard my previous post lol.   

 

My nginx is still running locally (not in docker) and emby is running in a docker.

 

It's working fine. I can play video with no issues and everything else seems OK. Anything I can specifically check?

Edited by paulmorabi
Link to comment
Share on other sites

pir8radio

My nginx is still running locally (not in docker) and emby is running in a docker.

 

It's working fine. I can play video with no issues and everything else seems OK. Anything I can specifically check?

 

 

You can try using a chrome browser, developer tools (right click "inspect") reload the page see if you have any errors in the error section.   

Edited by pir8radio
Link to comment
Share on other sites

paulmorabi

You can try using a chrome browser, developer tools (right click "inspect") reload the page see if you have any errors in the error section.   

 

There are no errors or issues at all with viewing and playing media.

 

on the dashboard, I get a few 404 errors loading the chrome and plugin logos. Is that resulting from this?

Link to comment
Share on other sites

pir8radio

There are no errors or issues at all with viewing and playing media.

 

on the dashboard, I get a few 404 errors loading the chrome and plugin logos. Is that resulting from this?

 

yea probably...  you can try remove emby from the location /   and see if they go away..

Link to comment
Share on other sites

paulmorabi

yea probably...  you can try remove emby from the location /   and see if they go away..

 

I'm running other services from different locations so that is why I put /emby in place.

 

Is there a fully working config for /path reverse proxies?

Link to comment
Share on other sites

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
×
×
  • Create New...