Connect to VMs and NAS externally with reverse proxy

Currently reading
Connect to VMs and NAS externally with reverse proxy

18
4
NAS
DS1621xs+, RS2418+
Operating system
  1. macOS
Mobile operating system
  1. iOS
I've decided to open my DiskStation so I can access it externally and think I finally have grasped the fundamentals needed to accomplish this yet can't seem to get this working right despite reviewing countless forums, tutorials, and of course syno docs.

Prior to now, I have simply been able to connect to DSM locally or via Quick Connect

My current setup:
  • I've decided to disable Quick Connect and just use DDNS (myaccount.synology.me), which gets a "green light" connected status
  • Changed default DS ports (5000 and 5001) to 7100 and 7200
  • Forwarded port 443 on my router to 443 of the static IP 192.168.1.300 (which I've set for the DiskStation in my router)
  • Enabled the firewall within DSM and enabled all services associated with 7100 and 7200, HTTPS and reverse proxy, and 3389 for remote desktop (RDC)
  • Generated a Let's Encrypt cert for myaccount.synology.me making sure to include "*.myaccount.synology.me" in the SAN for wildcards
  • Have added two domains to the reverse proxy section:
    https://dsm.myaccount.synology.me:443 that forwards to http://192.168.1.300:7100
    https://rdc.myaccount.synology.me:443 that forwards to http://192.168.1.400:3389
    (400 is the static IP I assigned within a virtual machine, which I can connect to locally with the Windows RDC client)
  • Configured the LE certs for both additions to reverse proxy to be on the myaccount.synology.me cert
Problems
  • I can no longer connect to DSM (dsm.myaccount.synology.me) externally from WAN since I have disabled Quick Connect
  • I cannot connect to the Windows VM that has been set up via Syno VMM
What works
  • I can connect to DSM locally with 192.168.1.300
  • I can connect to the VM using RDC (Mac and PC clients) locally with 192.168.1.400
Other considerations
  • I've noticed when connecting to https://myaccount.synology.me that it does not connect securely but does connect to web station (it's installed but not set up, so the default landing page is there)
  • I am under the impression that I do not need to use a VPN since I'm using a reverse proxy
  • I don't have port 80 forwarded from my router (which I've tried) since I want to connect securely
  • I've tried generating a LE cert without SAN but want to use future subdomains without generating a new cert every time
  • One PC that I will be using to access the VM remotely does not have admin access so I cannot install a VPN client but will allow me to enter RDC info, hence why I'm trying to avoid VPN (plus I have plenty of reverse proxy use cases I'd like to be available in the future)
I realize there are many things to investigate but suspect I'm not port forwarding something properly (despite checking for typos) or have a firewall issue.

Current DSM firewall rules
Screen Shot 2021-07-31 at 1.02.31 PM.png


Eventually, I plan to move away from the built-in reverse proxy that DSM offers but am simply experimenting for now and am curious to see what the experience is like using a VM from my own remote server without a VPN connection. Maybe I completely missed an important point (several times) in my research but any thoughts or comments will be greatly appreciated.
 
I've noticed when connecting to https://myaccount.synology.me that it does not connect securely but does connect to web station (it's installed but not set up, so the default landing page is there)
That would point to the fact that reverse proxy is wrong or port forward on the router
 
That would point to the fact that reverse proxy is wrong or port forward on the router
I failed to mention any of the resources I previously reviewed, one in which is from your site (and also posted on this forum somewhere) Synology Reverse Proxy

Beginning with the router, I know for certain I am forwarding 443 as shown below

Screen Shot 2021-07-31 at 3.30.40 PM.png


I do not have UPnP enabled on my router. Do I also need to forward ports in:
DSM Control Panel → External Access → Router Configuration?
Screen Shot 2021-07-31 at 3.15.19 PM.png


I am under the impression this is for UPnP connectivity if I want DSM to handle everything with my router for me so I don't have to manually do so myself.
 
I am under the impression this is for UPnP connectivity if I want DSM to handle everything with my router for me so I don't have to manually do so myself.
Correct, upnp is not needed.

Well, there is no much when it comes to reverse proxy, I just said that the common situation for an error of that type is wrong to reverse proxy config, as you are landing on the default page for the web station.

Are you sure that the settings for the reverse host are correct? Also, the connection is not secure, which means that your certificate could be a problem as well. Have you configured your reverse proxy host to match and use a certificate on your nas?
 
Last edited:
Are you sure that the settings for the reverse host are correct?
Not entirely sure but here's what I have:

Screen Shot 2021-08-01 at 9.08.53 AM.png


Screen Shot 2021-08-01 at 9.09.30 AM.png


Also, the connection is not secure, which means that your certificate could be a problem as well. Have you configured your reverse proxy host to match and use a certificate on your nas?
I'm using a wildcard cert, which I believe only works with synology.me DDNS (I noticed a comment at the reverse proxy post on Blackvoid that seems to contradict this, so maybe I do need a cert for each??)

Screen Shot 2021-08-01 at 9.12.37 AM.png
 

Attachments

  • Screen Shot 2021-08-01 at 9.09.30 AM.png
    Screen Shot 2021-08-01 at 9.09.30 AM.png
    66.2 KB · Views: 44
RP hosts look fine, but the cert is not a wildcard one. If it was it would be "*.yourname.synology.me". I do see that you have it configured to be used with your 2 hosts, but I do not see any SAN values in that cert, and if its not a wildcard one, then it will be working only for yourname.synology.me domain name (not the subdomains).

So that might be the problem regarding your SSL part.

Still, with that problem, getting access to your RPs is a separate issue. .300 is your NAS IP address, correct?

Do you have any firewall configured on that NAS?
 
Dsm reverse proxy destination should be httpS and httpS port
Not needed. It will work on http as long as the port is correct. But what @Gerard said was actually my next question.

What is your HTTP and HTTPS port for DSM and do you have redirect configured from http to https?
 
Dsm reverse proxy destination should be httpS and httpS port
Thanks @Gerard! This solved one of my issues, the issue that wasn't allowing me to connect to DSM using dsm.myaccount.synology.me.
  • I updated to HTTPS and changed to the 7001 secure port
However, after looking through much documentation, I understood that the destination is fine to be HTTP since this connection is happening behind the reverse proxy and local to the NAS.
 
However, after looking through much documentation, I understood that the destination is fine to be HTTP since this connection is happening behind the reverse proxy and local to the NAS.
correct but that means that you might have auto redirect configured on your dsm.

At least now you can focus on the ssl elements
 
RP hosts look fine, but the cert is not a wildcard one. If it was it would be "*.yourname.synology.me". I do see that you have it configured to be used with your 2 hosts, but I do not see any SAN values in that cert, and if its not a wildcard one, then it will be working only for yourname.synology.me domain name (not the subdomains).
As noted in my reply to @Gerard, I am now able to connect to DSM securely with dsm.myaccount.synology.me. I shall note that my browser also displays the lock icon, so I feel that wildcard is set up correctly (since I only have one cert and myaccount.synology.me still goes to the Web Station page).

Still, with that problem, getting access to your RPs is a separate issue. .300 is your NAS IP address, correct?
Yes

Do you have any firewall configured on that NAS?
Yes, the firewall is enabled on DSM as noted in a reply above. However, I have made some changes to the RDC ports but still cannot seem to connect through the RDC app.

Updated firewall settings shown, which include both 3389 and 3390 ports for TCP and UDP bot set as destination (I also tried setting these as source with no luck either)

Screen Shot 2021-08-01 at 11.11.03 AM.png


When attempting to connect to the VM remotely using the correct URL (i.e. rdc.myaccount.synology.me), I continue to get the same error as shown

Screen Shot 2021-08-01 at 11.18.31 AM.png


I can confirm that I have set a static IP within the Windows OS of the VM that is 192.168.1.400 (this displays in both the VMM interface and my router as the address).

Remote connections are enabled in the Windows guest OS as mentioned previously because I can connect locally. (The remote machine is also turned on)
 
Personally I suggest not to open 3389 RDP to the internet. That’s just plain dangerous.

Would recommend a vpn back to lan and the. running rdp connection “locally”.

This will eliminate the need to troubleshoot this problem and increase security.
Okay, I guess I will try to see if I can configure a VPN client with the Windows machine that is needing to connect to the VM remotely. It's a PC that does not have admin access and a lot of things are locked down, which is why I was trying to connect to the VM in a similar way that I am connecting to DSM remotely.

Thanks for your help @Rusty !
 
Last edited:
If you’re trying to access 3389 (rdp) through a web browser (http/httpS) it won’t work. The reason is because rdp isn’t (and can’t) run as an http(s) protocol.

only way that will work is connect vpn, then use the rdp apps to connect.

only way to accomplish this, is look for a remote access software based off http protocol. Maybe vnc viewer in a web browser, you’ll have to read up it and may require some leg work to setup. Honestly vpn to rdp is easiest, so that, as @Rusty mentioned, it’s one less thing opened and exposed to the internet.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

  • Question
Mmm..., looks like the problem was that we were connected to a dead network port. When livened up, all...
Replies
4
Views
1,063
Howdy! After a long wait with internet companies, we've finally got our new line in to the new office. I...
Replies
24
Views
2,206
Replies
2
Views
1,056
  • Solved
<<<<< SOLVED >>>>> OK so I decide to solve this by myself accordingly. Synology did offer me to go check...
Replies
1
Views
1,347
  • Question
Sorry for the delayed response; had a little mishap at home last week, As I mentioned previously, the...
Replies
17
Views
6,079
Also, Quick Connect isn't available for all services... especially if you are going to be relying on the...
Replies
3
Views
1,188
  • Question
I will try next Wednesday, I only have access to the NAS on days when the company is closed. Yes i assign...
Replies
15
Views
1,622

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top