Skip to content

Commit c2a4c2e

Browse files
codingfrog27yuri91
authored andcommitted
added docs for setting up proxy server to use headscale
1 parent 3bad262 commit c2a4c2e

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,24 @@ It is recommended to use an ephemeral key.
5858

5959
We also support [headscale](https://headscale.net/stable/), a selfhosted open source implementation of the Tailscale control server.
6060

61-
to log in to your headscale network add `#controlUrl=<your-control-url>` to the webVM url.
61+
Though as headscale unfortunately doesn't support adding CORS headers. You will have to set up a proxy server to add them. Headscales instructions on doing so can be found [here](https://headscale.net/stable/ref/integration/reverse-proxy/#nginx).
62+
63+
Once ready, add the following line to your `location /` block in your nginx config file.
64+
65+
``` Nginx
66+
if ($http_origin = "https://webvm.io") {
67+
add_header 'Access-Control-Allow-Origin' "$http_origin";
68+
add_header 'Access-Control-Allow-Credentials' 'true' always;
69+
}
70+
```
71+
72+
73+
To log in to your headscale network add `#controlUrl=<your-control-url>` to the webVM url.
6274

6375
**Notes:**
6476

65-
- this is equivelant to the tailscale `--login-server` command line option.
77+
- If self hosting, replace "https://webvm.io" with your own url.
78+
- This is equivelant to the tailscale `--login-server` command line option.
6679
- If used with authkey, don't forget to seperate the URL fragments with a `&` inbetween.
6780

6881

0 commit comments

Comments
 (0)