NodeJS application on WebStation Virtual Host

This forum is for devlopers to discuss questions about apps/plug-ins/extension modules/API specifically developed for using with Synology DiskStations.
Forum rules
Synology Community is the new platform for the enthusiasts' interaction, and it will soon be available to replace the Forum.
bogdanim36
I'm New!
I'm New!
Posts: 8
Joined: Tue Nov 14, 2017 10:13 am

NodeJS application on WebStation Virtual Host

Unread post by bogdanim36 » Tue Nov 14, 2017 5:16 pm

I have my first nodeJs application, which I try to install on my Synology DS216Play.
I create a Virtual Host YamahaCtrl, pointed on /volume1/web/YamahaCtrl folder, where I have app files.
I need to start app server . I did that with port 8080.
I didn't find a way to set Virtual host to use the api on this port:
- If I use setting Name-based, the api not pointed to same port (and url).
- If I use setting Port-based, I cannot start nodejs server on same port.
What solution do I have

bogdanim36
I'm New!
I'm New!
Posts: 8
Joined: Tue Nov 14, 2017 10:13 am

Re: NodeJS application on WebStation Virtual Host

Unread post by bogdanim36 » Wed Nov 15, 2017 7:18 am

I figured out what the problem was:
a mistake on setup static files location on nodejs application.
It's no need to configure something on NAS, just to start application on a available port.

czizes
I'm New!
I'm New!
Posts: 2
Joined: Tue Jul 17, 2018 11:31 am

Re: NodeJS application on WebStation Virtual Host

Unread post by czizes » Tue Jul 17, 2018 11:35 am

hey @bogdanim36

I'm having trouble just to engage, initialize ... just run any Node app on my Synology ds214play. I was trying to set up virtual host (name based and port based) to be exactly as my server.js settings but then I guess I had collision between node settings and vhost settings...I'm trying to set up a node website on /volume1/web -> any subfolder there.

Can you share your exact settings you've created to make it work?

Many thanks in advance,
Cziz.

bogdanim36
I'm New!
I'm New!
Posts: 8
Joined: Tue Nov 14, 2017 10:13 am

Re: NodeJS application on WebStation Virtual Host

Unread post by bogdanim36 » Tue Jul 17, 2018 11:55 am

You don't need to setup a Virtual Host, the port is setup in nodeJs, and it's enough.
Virtual host is for Appache or nginx, not nodeJS.

czizes
I'm New!
I'm New!
Posts: 2
Joined: Tue Jul 17, 2018 11:31 am

Re: NodeJS application on WebStation Virtual Host

Unread post by czizes » Wed Jul 18, 2018 2:53 pm

Hi,

I just want you to know that you are right but this wasn't the case for me. As you mentioned, when you create a listening server anywhere in /volumen/web/another_path_anywhere on some kind of port and you will relete to it in the browser using your ip, it will show the page no mater what folder it is in.

In my case there was additional problem caused by router firewall that was blocking some ports. When I forwarded it locally for my NAS (static IP) and my ISP IP for those ports I wanted to host Node it worked fine.

Thank you for your support,
BR, cziz.

bogdanim36
I'm New!
I'm New!
Posts: 8
Joined: Tue Nov 14, 2017 10:13 am

Re: NodeJS application on WebStation Virtual Host

Unread post by bogdanim36 » Wed Jul 18, 2018 3:05 pm

I'm not sure I understand you problem. You have problem with port forward on router?

Post Reply

Return to “Developer Discussion Room”