mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
Nodes connected to headscale fail to see each other if headscale is fronted by nginx #12
Closed
opened 2025-12-29 01:19:48 +01:00 by adam
·
22 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#12
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @viq on GitHub (Jul 17, 2021).
Descriptions
Machines manage to authenticate to headscale, see each other's existence in
tailscale status, but cannot ping each other.They are able to discover and ping each other fine when using tailscale infrastructure, or when talking to headscale directly, without nginx in the way.
Situation
Two machines running OpenBSD-current, tailscale
1.10.2, headscale0.3.4headscaleis running headscale with postgres, tailscale, nginx in front of headscale for TLS termination; has public IP, tailscale told to listen on specific port and that port opened on firewallinnernet-testis behind NAT (aggressive). Runs only tailscaledConfiguration
headscale
nginx
Logs
Part 1
Attaching machines to headscale
nginx
headscale & tailscaled
headscale machine
innernet-test machine
At this point daemons were stopped. Situation at this point:
tailscale statusoninnernet-testshows both machines, onheadscaleshows only itself.headscale -n viqWORKS nodes listshows both machines.Part 2
At this point I'm rotating logs, starting daemons, and will run status and ping
Logs
headscale machine
nginx
headscale & tailscaled
innernet-test
tailscaled
@viq commented on GitHub (Jul 17, 2021):
In case it's relevant, registration has been done using authkeys.
@juanfont commented on GitHub (Jul 17, 2021):
Can you add the output for this:
headscale -n viqWORKS nodes list -o json@viq commented on GitHub (Jul 17, 2021):
@viq commented on GitHub (Jul 18, 2021):
How does the http connection work? Looking at tcpdump, I see a bunch of
Connection: closebetween nginx and headscale, but not when tailscaled and headscale are talking directly. Maybe nginx needs some tuning for long polling or whatnot?@viq commented on GitHub (Jul 18, 2021):
OK, so seems like some of the settings from https://help.hcltechsw.com/connections/v65/admin/install/inst_post_nginx.html may have helped...
@viq commented on GitHub (Jul 18, 2021):
Currently seems to work with the below settings, I'll poke at it some more at a later time.
@juanfont commented on GitHub (Jul 18, 2021):
I have not been able to replicate the issue in my Vagrant setup, aside the
longpolling connections being closed after 60 secs (nginx's default) as
expected
Would in be possible to have access to your environment?
On Sun, Jul 18, 2021, 20:16 viq @.***> wrote:
@viq commented on GitHub (Jul 22, 2021):
Update: currently 2 vhosts,
headscale.viq.vcwith "broken" config as previously, andtestscale.viq.vcwith I think working config:You still have access, feel free to poke around.
@viq commented on GitHub (Jul 22, 2021):
Hm, looks like with those settings I need to restart
headscalefor nodes (either new, or after being restarted) to see each other.@juanfont commented on GitHub (Jul 25, 2021):
I have been finally able to replicate this 😄
I will check nginx configs now...
@juanfont commented on GitHub (Jul 30, 2021):
@viq @bharathmsd7
Can you check with this config in nginx?
https://github.com/juanfont/headscale/wiki/nginx-configuration
@qbit commented on GitHub (Jul 30, 2021):
Switched my config over to nginx, this seems to resolve it for me - I am able to ping hosts and ssh to them!
@qbit commented on GitHub (Jul 30, 2021):
It seems that after a while though things break down. I was adding hosts to a namespace and now
tailscale up --login-server ....just hangs.I see
Client is registered and we have the current NodeKey. All clear to /mapand then a POST to/machine/ID, but nothing after that.@viq commented on GitHub (Jul 31, 2021):
With following config
(disabling websocket related things one by one; finally
proxy_http_versionseemed to make a difference) after a couple restarts of various things I was still able to register clients, without the issues @qbit is describing (I would see them sometimes otherwise; might still as it's not necessarily 100% repeatable). But adding a new (ephemeral) node to headscale, none of the two so far connected nodes see it without restarting things. Which I guess is the same state as we started with...@viq commented on GitHub (Jul 31, 2021):
I'm now retrying with exactly your set of options.
@viq commented on GitHub (Jul 31, 2021):
Specifically:
and I'm apparently seeing what you described, i.e.
headscaleseeing clients closting the connections, but nginx and tailscaled believing they are still open.@juanfont commented on GitHub (Jul 31, 2021):
Can you send us the logs from the tailscaled daemons failing to connect?
@qbit commented on GitHub (Aug 4, 2021):
Ya, i'll try and get some more details today - It looks like the same behavior as #50 though.
@juanfont commented on GitHub (Aug 6, 2021):
@qbit @viq Can you please try with v0.5.0? https://github.com/juanfont/headscale/releases/tag/v0.5.0
@Juliaria08 commented on GitHub (Aug 14, 2021):
It fixed the issue i had and it is now working, thanks for the work of this project
@juanfont commented on GitHub (Aug 24, 2021):
@viq @qbit can you check 0.7? This issue should be solved now.
@qbit commented on GitHub (Aug 24, 2021):
Can confirm! Currently running just fine!