NIP-42 failed on non-443 with Flotilla(used behind nginx in Flotilla because of port mismatch) #2

Closed
opened 2026-04-14 01:51:39 +00:00 by npub15skvhry · 7 comments

this is my original issue link in github: https://github.com/coracle-social/zooid/issues/13
i showed the error and the line that cause it in the above link
in summary i have a nginx running on non-default port(8443) and the auth request fails because the public relay url that zooid thinks it has does not contain port i cannot include port in host in zooid config file

this is my original issue link in github: https://github.com/coracle-social/zooid/issues/13 i showed the error and the line that cause it in the above link in summary i have a nginx running on non-default port(8443) and the auth request fails because the public relay url that zooid thinks it has does not contain port i cannot include port in `host` in zooid config file
Owner

Thanks for re-opening, I believe this is a configuration error, the host should include the port the client is connecting on (8443 if I understand correctly). Why aren't you able to set the port in the config file?

Thanks for re-opening, I believe this is a configuration error, the host should include the port the client is connecting on (8443 if I understand correctly). Why aren't you able to set the port in the config file?
Author

i tried "zooid.mydomain.com:8443" in zooid configuration but then zooid sends 404 for everything.
my guess is that i does that because:
client request(from x to zooid.mydomain.com:8443) -> nginx -> sets Hosts header to "zooid.mydomain.com" and sends it to zooid -> zooid -> compares request Hosts header with host included in configuration file which means "zooid.mydomain.com" != "zooid.mydomain.com:8443" -> so returns 404

i tried "zooid.mydomain.com:8443" in zooid configuration but then zooid sends 404 for everything. my guess is that i does that because: client request(from x to zooid.mydomain.com:8443) -> nginx -> sets `Hosts` header to "zooid.mydomain.com" and sends it to zooid -> zooid -> compares request `Hosts` header with `host` included in configuration file which means `"zooid.mydomain.com" != "zooid.mydomain.com:8443"` -> so returns 404
Author

now i tried doing proxy_set_header Host $host:$server_port; instead of proxy_set_header Host $host; in nginx and still same issue (edit: now i understand why this failed too. i had using a nginx stream block which redirects requests to nginx http block. in my situation this makes $server_port wrong value and it's not equal to 8443)

now i tried doing `proxy_set_header Host $host:$server_port;` instead of `proxy_set_header Host $host;` in nginx and still same issue (edit: now i understand why this failed too. i had using a nginx stream block which redirects requests to nginx http block. in my situation this makes `$server_port` wrong value and it's not equal to `8443`)
Author

Wowwww. replacing proxy_set_header Host $host; with proxy_set_header Host $http_host; in nginx and using host with port in zooid configuration seems worked!!!
thank you very much

Wowwww. replacing `proxy_set_header Host $host;` with `proxy_set_header Host $http_host;` in nginx and using `host` with port in zooid configuration seems worked!!! thank you very much
Author

can you place add a notice in README to notify peaple that they should include port in host zooid configution if they are not using 443?

can you place add a notice in README to notify peaple that they should include port in `host` zooid configution if they are not using 443?
Author

and using wrong proxy_set_header Host $host; is very common. it's nice to have a notice for that too.
i found that in this link: https://serverfault.com/questions/363159/nginx-proxy-pass-redirects-ignore-port#407983

and using wrong `proxy_set_header Host $host;` is very common. it's nice to have a notice for that too. i found that in this link: https://serverfault.com/questions/363159/nginx-proxy-pass-redirects-ignore-port#407983
Owner

Thank you for the detailed information! Fixed in 64bde74

Thank you for the detailed information! Fixed in 64bde74
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/zooid#2