Connect domain to nodejs server hosted on vps instead on ip + port - node.js

i have 2 react apps and a nodejs server (express and websocket) running on port 8000.
the express server is for generating random links and the websocket for sending real-time messages between the apps.
my apps worked perfectly after hosting on my vps server but after connecting letsencrypt ssl to both react apps, they don't work anymore because i have to connect to a websocket with secure connection.
so i want to connect the nodejs server with a subdomain i have from namecheap.
i have tried pointing the subdomain i got for the server to the ip of the vps but i don't know what to do after that.
should i create a new file just like i did for the previous apps in the sites-available directory, listen to port 8000, set server name to the intended subdomain and run a proxypass to the same subdomain?
This is my first time hosting on a vps server, i'm very confused at the point but my server works well when i just type in ip:8000 on my brower

Related

DNS Not pointing to VPS

So I recently have been working on a project that is using express js to host a discord bot and dashboard (website). My issue now is that the website works on the ip of my vps and port 3000, but when I attempt to point my domain to it using A record, it just nothing shows when i go to the domain.

How build to deploy node app to http server

Is there any way to use express or other nodejs librarys to to design an api and deploy it pasting files as a resource path in a web server just like react.
My web server just listen on ports 80 and 443.
I have pages on domain.com/page1 domain.com/page2.
and i want to deploy an api listening on domain.com/page3 but i cant install a nodejs server and proxy requests to page3 to it.
Thanks a lot
There can be only one web server listening on a given port. You can directly "listen to a path", only a port.
So, if you already have an existing web server running on ports 80 and 443, then these are your options.
Modify your existing web server to add your API server code to it so it can handle requests for http://yourdomain.com/page3 and https://yourdomain.com/page3 directly with your API.
You can add some middleware to your existing web server to make it a proxy for http://yourdomain.com/page3 that will redirect requests to your http://yourdomain.com:3000/page3 Express-based API server.
Run your own Express-based API server on your own separate port and access the API server directly via the separate port such as http://yourdomain.com:3000/page3.
You can install a proxy such as nginx in front of your existing web server and have it redirect incoming requests to http://yourdomain.com/page3 and https://yourdomain.com/page3 to the separate port that your Express-based API server is running on.

Deploy nodejs express on AWS windows server

I deplyoed my nodejs application on a AWS server with windows server as OS. The application is a simple express server running on https port 443. The application is accessible through localhost, but I can access the app through public IP.
Here are a few things I tried:
IIS with urlrewrite like so (https://dev.to/massivebrains/deploying-node-express-app-on-a-windows-server-2l5c)
iisnode
I am still not able to access my app. I setup up inbound rules in my firewall for the port and nodejs itself.
The issue was simply in my security group. I had set up the IP addresses I was expecting, but one was missing. It is working now.

How to set ssl certificate on aws ec2 instance?

I want to use https (port 443) for my web app which is developed using NodeJS express mongodb.In order to do that I know I need to get ssl certificate. My app is hosted by Amazon ec2. My express server listens port 3000.I created ssl certificate using Amazon Certificate manager ,and I also set up apache following some tutorial. However when I go to port 40 I see apaches page (I used to see my app here since I redirected port 80 to 3000 before). When I do https request it just gives me nothing.I set load balancer and attached to my ec2 instance.Is there a good tutorial or can you tell me what I am missing? This became so annoying.

Google Cloud Node.js Socket Server Application Hosting

I have two node js application. One of them is a webserver. It serves static html css javascript and image files. This web server is running on google cloud app engine. I have a domain that is bind to this app engine. And whenever a user visits my domain my webserver gives responses to it and it gets my frontend of my website.
The other node application is a socket server(socket io). It runs on a compute engine and i want this socket server to communicate securely. Because there are important messages for me in a communication of client and server sockets. Thats why i bought an ssl certificate.
I applied my ssl certificate to my domain and now i want my client sockets to connect to a port of my domain(for example to https://www.example.com:8443)
However i dont know how to forward 8443 port of my domain into my compute engine's 8443 port without terminating the https security.
How can i do that?
Thank you in advance
Well the Google Console has a networking section from where you can open ports for your applications. See this link: https://console.cloud.google.com/networking/firewalls/list?project={your-project-id}. Replace {your-project-id} with your project id.
Another option is that instead of using a ssl certificate, you can encrypt the messages sent between your server and client

Resources