I have following network situation: Router 192.168.1.1 (portforwarding 80 to 192.168.1.20 Raspberry) Raspberry 192.168.1.20 with nginx running. Synology NAS 192.168.1.10 with "synology drive" service running.
On the Raspberry 192.168.1.20 nginx conf file I have a redirection for the subfolder /drive. Because I want to redirect to the Synology NAS to be able to use the "synology drive" service.
Therefore I've created following entry on the Raspberry nginx server in the conf file:
location ^~ /drive {
rewrite ^/drive/?(.*)$ 192.168.1.10/$1 permanent;
}
This redirection kind of works. But only when I'm on the same local network. My problem is now that I have a domain name pointing to my router (static ip). But if i use mydomain.tld/drive then the redirection doesn't work.
Does anyone know how to achieve this?