2

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?

Miracuru
  • 65
  • 6

1 Answers1

1

You need to use the proxy_pass directive

miknik
  • 5,748
  • 1
  • 10
  • 26
  • Thank you @miknik for your input. As I'm not yet familiar with nginx I have booked now a course on udemy.com. And there's a chapter for proxy_pass. So I go through this. – Miracuru Sep 11 '21 at 10:32