Additional information about your network (Hardware you are trying to connect to , hardware you are trying to connect from , router, access point, used operating systems, ...)
Debian Buster. Octoprint 1.4.2
Nginx config file https://pastebin.com/GspsLDeq
Nginx works with letsencrypt and has a redirect from HTTP to HTTPS.
In firefox inspector doing GET /octoprint/ I see:
You don't seem to have JavaScript enabled
OctoPrint's UI requires JavaScript to work. Please enable JavaScript and reload.
Also having lots of simmilar JS errors in console:
Could not bind view model UiStateViewModel to target #page-container-main : parseBindingsString@https://ibox.netng.pl/octoprint/static/webassets/packed_libs.js?df208d52:3:6802
Could not bind view model AboutViewModel to target #footer_about : parseBindingsString@https://ibox.netng.pl/octoprint/static/webassets/packed_libs.js?df208d52:3:6802
Test 1 : add the trailing slash in the « location » stanza proxy_set_header X-Script-Name /octoprint becomes proxy_set_header X-Script-Name /octoprint/
Test 2 : verify the http_upgrade stanza
In your partial config file, we see the proxy_set_header Upgrade $http_upgrade
Is you map defined in the http block ?
Test 3 : try using http before enabling https
(hey, IT Sec engineer hat on : please never consider http for production :D)
It seems like your browser can't get the websocket / js working. It might be related to TLS restrictions in your browser.
Didn't help. I have same https working with nginx for other sites without any issues. I've enabled nginx to listen on non standard port with https which works. Issues seems to boil down to /octoprint
To be sure : the nginx stanza you posted (the one without the "location /octopi/") is working, right ?
May I ask you an other test ? It would be about variations on the location definition.
location /octoprint location = /octoprint/
My feeling gut, location /octoprint is better (cause it says "/octoprint" AND "/octoprint/"). I don't know how the websockets of Octoprint work exactly but it may be reached on /octoprint while ressources are located under /octoprint/*, hence the location /octoprint hypothesis.
New one, if you're okay ? I feel like the non-standard port may have a impact on the websocket (though I'm not really sure …). What if you add (to your original config, you may throw our previous tests I guess)
I start fearing that the sockjs implementation in Octopi doesn't use the non-standard port in your URL scheme. Maybe @foosel have an input on this ?
For me, sockjs fails at the initialization, for an unknow reason. Could be the port, could be something else, and as my knowledge on WebSockets reaches here its limits, I may have to let that sink for a while and see if anyone has a better view on that.
I feel like we narrowed the bug down to the "location /" vs "location /octoprint" in your nginx file.
Question : Is the port 5000 closed on your server ?
Rationale : how possible is it (in your opinion) that your browser is going directly to :5000 where it actually should go through 5050 (nginx) ? Can you check that octoprint listening on localhost only ?
I would probably try both state:
octoprint closed (127.0.0.1 + port 5000 firewall'd)
octoprint opened (listen on 0.0.0.0 + port 5000 open too)
Just to see if there's a strange behavior from the UI trying to reach "/" instead of "/octopi" (or /whatever) when there's also a custom port