I try to setup sync in the desktop application v3.0.12. An error occurs when pressing the "Check synchronisation configuration" button.
Error. Please check that URL, username, password, etc. are correct and that the sync target is accessible. The reported error was:
Error 404 Not Found: {"detail":"Not Found"} (Code 404)
But the site is accessible and I can log in my account.
Request in the nginx access log on pressing "Check synchronisation configuration" button:
I'm not really knowing what the problem is. I'm just a copy&paste Admin.
I use a subdomain for my Joplin Server and have a very simple reverse-proxy config under /etc/nginx/conf.d. The ssl magic is done by certbot. And this works for me.
Maybe this is also a way for you? You can then reach your server under joplin.domain.tld.
If you want to try this, make a new file named joplin.conf under /etc/nginx/conf.d and fill it up with this simple reverse-proxy config:
joplin.domain.tld have to be your own domain with a subdomain.
After that, I use certbot to gain a ssl certificate. Maybe you have to install certbot first. and the run just sudo certbot and chose your domain with the right number. Certbot does the rest for you.
After that, your joplin.conf under /conf.d looks a little bit different, like this:
server {
server_name joplin.domain.tld;
location / {
proxy_pass http://localhost:22300/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 2048M;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/joplin.domain.tld/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/joplin.domain.tld/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = joplin.domain.tld) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name joplin.domain.tld;
listen 80;
return 404; # managed by Certbot
}
If you want to keep your config like it is, you maybe have to take a look at the proxy_set_header-functions. There is a difference between yours and mine. Maybe you have to add proxy_set_header X-Forwarded-Proto $scheme;. But this is just a wild guess. I don't know really for what this is for.
Have you double check, that you have set https:// in your synchronisation URL in Joplin? Because you only listen on port 443 and not on port 80 and you don't have an automatic redirect to ssl and port 443.
Unfortunately, I can't use a subdomain for joplin only. Several web apps are served by the same domain. I use acme.sh to manage certificates. Joplin Server web interface works properly along with other services.
Okay, I edited my config as close to yours as possible (added X-Forwarded-Proto, removed extra lines, etc.) but nothing changed in operation. I checked https in the desktop app again and added a forced rewrite to https from port 80 in nginx.conf. Same error in the application. Also, I don't see any messages in log.txt when trying to sync.
Another interesting fact. Joplin desktop request to https://xxx.yyy/joplin/api/sessions. When I trying to open such page in the browser I get a strange screen with json tab with single field - {"detail":"Not Found"}.
curl https://xxx.yyy/joplin/api/sessions -v
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 404 Not Found