Closed NeoHuncho closed 6 months ago
Experiencing the same issue here. Behavior is persistent across Firefox Nightly 125.0a1 (2024-03-02)
and Microsoft Edge 123.0.2420.10
on Windows 11, and Samsung Internet v23.0.1.1
on a Tab S7+ running One UI 5.1. Affine looks gorgeous and I would love to use it as an Obsidian replacement!
AFFiNE uses the websocket protocol to sync data with the cloud. Please refer to nginx's official blog or other articles to configure websocket support for your nginx: https://www.nginx.com/blog/websocket-nginx/
Okay, thanks for the answer, I will have a look :)
If you're just starting to configure your server, you might also consider caddy, which has https and websocket support out of the box: https://caddyserver.com/docs/
If you just want to access the services on your server from anywhere, you can also consider tailscale or zerotier, which allow you to connect directly to your server in an encrypted manner through a fixed IP or private domain name at any network, and do not require purchasing a domain name and configuration https
For anybody using nginx proxy manager and having the same issue:
you just need to edit your proxy host and enable websockets on the details tab (see image)
Thanks for the answer and suggestion @darkskygit ! Maybe it could be interesting to add a footnote on web sockets on the self-hosting guide. I can open a PR if needed :)
Thanks for the answer and suggestion @darkskygit ! Maybe it could be interesting to add a footnote on web sockets on the self-hosting guide. I can open a PR if needed :)
the document in repo is outdated, now we have a internal affine workspace that is rewriting related documents once we complete the relevant work, we will publish it on our social accounts
Thanks everyone, enabling websocket support worked! For anyone in the future, here's what the block for affine looks like in my nginx conf file:
server {
server_name affine.your.domain;
location / {
proxy_pass http://localhost:3010;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
<auto-generated certbot SSL stuff here>
}
✅ Answered
The issue actually turned out to be a question or a misunderstanding, and it has been answered or resolved.
This is an automatic reply by the bot.
@gamersekofy Hi, I'm using nginx proxy manager too and I have the same configs as yours. But, I got cors error. Did you see it before?
Access to font at 'https://cdn.affine.pro/fonts/Inter-Light-BETA.woff' from origin 'http:/xxxxxxx:3010' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
What happened?
I’ve successfully self-hosted AFFiNE using the compose file found in the
.github
directory. Everything works perfectly when I’m on my local network, and I appreciate the amazing work!However, I encounter an issue when I use Nginx to allow external access to my self-hosted AFFiNE through the internet. Specifically, it remains in a constant loop of syncing for the workspaces that I created and synced on my local network, as well as for new ones that I make.
Could someone please help me figure out why this is happening? Thank you!
Distribution version
macOS x64 (Intel)
What browsers are you seeing the problem on if you're using web version?
Chrome
Relevant log output
In my chrome console I have multiple of the same error:
The only log that is popping is from the affine_selfhosted service (every ~30 seconds)
Anything else?
No response
Are you willing to submit a PR?