openbroadcaster / observer

:radio: OBServer Automation, Scheduler, Media Library and Player Manager
https://openbroadcaster.com
148 stars 44 forks source link

[Bug] Accessing Web Interface via Port Forwarding redirects to /welcome/ incorrectly #72

Closed alphabitnz closed 1 year ago

alphabitnz commented 2 years ago

I have set my router to port forward for external access to OB Server since I don't want to expose port 80. However when I browse to <hostname>:<externalport> OB Server tries to redirect back to https://<hostname>:80/welcome/

Manually inserting the correct external port after the hostname then produces Error code: SSL_ERROR_RX_RECORD_TOO_LONG Stripping https and using http://<hostname>:<externalport>/welcome/ does then produce the login screen, and everything works as expected once I am logged in.

brookgagnon commented 1 year ago

Turned out to be an issue with nginx configuration, though OB wasn't helping. OB was redirecting to "/welcome" (without trailing slash) instead of "/welcome/". The server would do another redirect to add the trailing slash, but since the local port was 80, it would redirect to the wrong port. Fixed on OB develop branch by redirecting with trailing slash. In addition, nginx should be configured correctly one way or another to avoid this.

nginx redirects subdirectory requests without trailing slash to a URL with specified port

Suggestion to disable absolute redirects using and have nginx do relative redirects (which is what OB does).