Jump to content

Recommended Posts

Posted

Hi

I have my emby server behind a reverse proxy using nginx. The url is set to mydomain.com/emby. I'm using ssl and set everything on port 80 to redirect to ssl (http to https)

The problem is when connecting to the server via an app. If I write https://mydomain.com, everything works. I would also like to be able to use just mydomain.com. Now when using mydomain.com it connects to the server, but i get a login error stating that my password is wrong for my user (which it is not). When I look at the logs in emby it's seems like it trying to login in using http and not getting redirected to https.

My nginx config for port 80 looks like:

server {
       listen 80;
       listen [::]:80;
       server_name mydomain.com www.mydomain.com;
       return 301 https://$server_name$request_uri;
}

for the redirect. Do I need to add anything else here?

Posted

Hi there, I would suggest comparing your nginx configuration to that of @pir8radio. Please let us know if this helps. Thanks !

Posted (edited)

Compared and tried that config to my own. Same result.

For the first two imagess I get an error if I don't forward http to https in nginx. If i forward http to https I can connect to the server in the first two images, but i get an  sign in error when i try to log on a user.

emby log say:
Error Server: Access token is invalid or expired.

image.png.fb0cf394bb3d7e7fffe55b276fe84850.pngimage.png.7094c7e25d0dfe1098eb9a154ede67cb.png

This one works perfectly:

image.png.0fff98e2d7bc22ecca2fc73829015f88.png

Edited by amb13
Posted

OK, I'm not really sure as this is specific to your personal environment, but you might want to look at the emby server log because incoming http requests get logged there.

You can compare the http test vs https, and then also look at your nginx request logs to determine  if the redirecting is happening properly.

Posted

Here is a log from trying to first connect with without https and the with https. Looks like it uses POST on https and GET on http

LOG: https://pastebin.com/BBActc29

Can you see anything?

Posted

All of that looks fine to me, and in fact, if you look at the server log, you can see that the authentication request has succeeded.

Posted (edited)

The one that succeeds is when I connect using https://mydomain.com

On line 12 you can see 2021-12-02 21:06:29.597 Error Server: Access token is invalid or expired. for when it's redirected from mydomain.com to https://mydomain.com

Line 1-13 is using just mydomain.com

and line 13-42 is https://mydomain.com

It's line 11 and 24 that differ between the two login attempts.

Edited by amb13
pir8radio
Posted (edited)

sub directory reverse proxy doesn't work well with emby..      I would suggest sub domain..     emby.yourdomain.com              /emby/ breaks things.    not all apps support it.  its difficult to get and keep working if you don't know the ins and outs of nginx.    Plus you need the headers and (minus the security section) in my example config to allow emby to play media correctly, and pass websockets info.

also most apps do not follow redirects!   you must enter https://yourdomain.com:443 in the emby apps.

 

Edited by pir8radio
  • Agree 1
Posted

Ok. thanks. Think I'll just change to emby.mydomain.com then. seems like the best solution.

I will still have to type https://emby.mydomain.com in all apps still? emby.mydomain.com won't do?

pir8radio
Posted
On 12/2/2021 at 6:40 PM, amb13 said:

Ok. thanks. Think I'll just change to emby.mydomain.com then. seems like the best solution.

I will still have to type https://emby.mydomain.com in all apps still? emby.mydomain.com won't do?

most of the apps require the https   and 443    yea i know it sucks..  lol    firetv android google  i have to do that on all of them.

Posted

That got of got me also a couple of times as https without a port means use port 443 when not specified.

But once you know to use both it's not a big deal.

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...