amb13 18 Posted December 1, 2021 Posted December 1, 2021 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?
Luke 42077 Posted December 2, 2021 Posted December 2, 2021 Hi there, I would suggest comparing your nginx configuration to that of @pir8radio. Please let us know if this helps. Thanks !
amb13 18 Posted December 2, 2021 Author Posted December 2, 2021 (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. This one works perfectly: Edited December 2, 2021 by amb13
Luke 42077 Posted December 2, 2021 Posted December 2, 2021 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.
amb13 18 Posted December 2, 2021 Author Posted December 2, 2021 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?
Luke 42077 Posted December 2, 2021 Posted December 2, 2021 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.
amb13 18 Posted December 2, 2021 Author Posted December 2, 2021 (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 December 2, 2021 by amb13
pir8radio 1312 Posted December 2, 2021 Posted December 2, 2021 (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 December 2, 2021 by pir8radio 1
amb13 18 Posted December 3, 2021 Author Posted December 3, 2021 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 1312 Posted December 6, 2021 Posted December 6, 2021 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.
Carlo 4560 Posted December 12, 2021 Posted December 12, 2021 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now