lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Can't logging when using NPM/Nginx Proxy Manager

Open woj-tek opened this issue 2 years ago • 2 comments

Do not use this for questions or support. Use !lemmy_support. ^^ unfortunately is overloaded hence asking here

I tried to setup lemmy instance and I can access it just fine but can't log-in.

In the (docker) logs I see:

lemmy-lemmy-1     | 2023-06-12T16:15:19.489000605Z 2023-06-12T16:15:19.488524Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: WebSocket upgrade is expected.

In the browser I see:

  1. request
GET /api/v3/ws HTTP/1.1
Host: <domain.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0
Accept: */*
Accept-Language: en-US,en;q=0.8,es;q=0.5,pl;q=0.3
Accept-Encoding: gzip, deflate, br
Sec-WebSocket-Version: 13
Origin: https://<domain.com>
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: I+…9hctQ==
DNT: 1
Connection: keep-alive, Upgrade
Sec-Fetch-Dest: websocket
Sec-Fetch-Mode: websocket
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
  1. response:
HTTP/1.1 400 No WebSocket Upgrade header found
Server: openresty
Date: Mon, 12 Jun 2023 16:12:14 GMT
Content-Length: 0
Connection: keep-alive

There was another issue that mention using NPM (#3019) but the issue seems to be slightly different there. I do have network separation and set services.proxy to be in the same network as NPM (so NPM could forward traffic to proxy/nginx and then it would go to lemmy).

Anyone else with similar setup?

woj-tek avatar Jun 12 '23 16:06 woj-tek

Can you post your nginx config?

null-dev avatar Jun 12 '23 16:06 null-dev

I'm using the default from https://join-lemmy.org/docs/en/administration/install_docker.html.

I also tried the one from the linked issue (https://github.com/LemmyNet/lemmy/issues/3019#issuecomment-1587583582) but without any luck.

woj-tek avatar Jun 12 '23 16:06 woj-tek

With a fresh mind... NPM has option "WebSocket support", which is disabled by default... my bad :-)

woj-tek avatar Jun 13 '23 20:06 woj-tek

With a fresh mind... NPM has option "WebSocket support", which is disabled by default... my bad :-)

I'm running into this, too. Where/how do I enable NPM's "WebSocket support" option? Sorry if it is obvious, but I am really unfamiliar with NPM.

ajdunevent avatar Jun 18 '23 21:06 ajdunevent

@ajdunevent image

Neshura87 avatar Jun 19 '23 10:06 Neshura87