FWIW there are a _ton_ of apps for both iOS and Android that will back up your photos and videos to your home NAS/server. Whatever you go with, ensure the files aren't being mucked with during or after the transfer--Google Photos on Android may omit and/or change some metadata tags, for example.
I personally use Resilio Sync [1] (for iOS and Android) and have tested SyncThing [2] (for Android), and PhotoSync [3] (for iOS and Android). They all work well.
Syncthing is an option, but it's typically for a different use case. Most people will want their photos backed up in a way that means they can delete the photos on their phone and still have a copy, but Syncthing would delete it on the NAS end as well.
There's an ignoreDelete option but the docs advise against using it[0] and IIRC the developers want to remove it.
One way sync would stop your server syncing back to the phone, but wouldn't you still need the ignoreDelete option to stop deletions on your phone syncing to your server?
The trick is to sync to the import folder and let photoprism import them, which removes them from that folder anyways. So your phone deletes have no effect, since the photos are not in the import folder anymore. I have my imports run every 10 minutes, so there is never a huge buildup of photos to process at once. It's been working great so far
Syncthing can do this and much more. Its the absolute best option to sync anything anywhere. It is very flexible, uses local connections, can only sync on wlan/certain wlans. The only thing that could be better is UX - for novel users its not so easy to understand. But people hanging out on HN should choose it as its just great!
I agree it's very good, and I use it for a lot of other folders eg notes, but I don't see how to use it as a backup tool for photos, without either using the option linked above or copying/hardlinking elsewhere on the NAS end. Unless there's a setting I'm missing that stops it from deleting on the NAS end?
EDIT: Don't get me wrong, it's my favourite file syncing tool, especially as one of the few open source syncing solutions. But I worry it always gets recommended as a backup tool and people don't realise it'll also sync deletions, so they'd suffer data loss.
Oh, I do use ignoreDelete. I additionally use git-annex on the receiving side, with the daemon running, so it automatically annexes the files and pushes to long term backup that way.
One thing I've done as well is to set up a simple script which gets run from a cron job and will let me know via email if it hasn't seen any new photos uploaded for 3 days (it's pretty unusual I'll go 3 days without taking a single photo on my phone). This provides a simple early warning for things like backup/sync apps getting killed by aggressive phone power management.
I personally use Resilio Sync [1] (for iOS and Android) and have tested SyncThing [2] (for Android), and PhotoSync [3] (for iOS and Android). They all work well.
[1] https://www.resilio.com/individuals/ [2] https://syncthing.net/ [3] https://www.photosync-app.com/home.html