Domain name in Node.JS [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a VPS on DigitalOcean.
I have a Node.JS and MongoDB application.
Now I want to pin my domain (myapp.com) to my Node.JS app.
Now I can run my app by IP like 192.xxx.xxx.xxx:8080. I want to have this on address myapp.com.
How to do that?

A domain does not point to an app but to a machine, so to start make sure your domain points to your VPS's IP, i guess you can access to DNS settings in your host's interface.
If your app is running on :8080 then http://myapp.com:8080 should then point to your app.
If you want your app to run on the http://myapp.com only (without :8080) you have to either launch the app on port 80 (which is the default http port) or install a reverse proxy that tunnels :80 to :8080.
I personally recommend using a proxy, as you would be able to add other NodeJs apps later, each running on different ports and beeing served through the proxy.
Nginx is used a lot as a reverse proxy for node or ruby applications, and you should find a lot of documentation for it.
Alternatively, to play pure NodeJS, have a look at node-proxy, it should suit your needs very well too.

Related

How to securely connect to VPS application which expects HTTP connection [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have a Virtual Private Server (VPS) running Debian 10. On this server there is an application (its code rather cannot be modified) which creates an open TCP/IP port (let's say 6000). The application has a simple database with users and passwords and all incoming messages MUST be HTTP.
Obviously, at this point I am more than worried about the security of the communication (which in fact does not exist due to the plain nature of HTTP).
My first thought would be to drop all packets on the mentioned port for the eth0 iface (which is exposed to Internet), create OpenVPN server on my VPS and connect to this VPN all clients that would like to use my application. The problem here is that these clients will most likely be Android devices and it will not be possible to upload certificates for each device and do other configuration magic to establish the VPN connection. I also would not like to implement OpenVPN in a dedicated Android app.
My another though was that there is maybe an application which I would start on the VPS and it would implement such logic:
Android app <--HTTPS--> UnknownApp(on VPS side) <--HTTP--> port6000(My original unsafe app also on the VPS side)
Is it feasible to implement such scenario? Ofc I could write such app on my own but I would prefer to use tested and reliable solutions.
The application you are looking for is stunnel. It does exactly what you described, it is well tested, based on well-known libraries, and production ready.

Apply ssl on a pm2 api with apache on linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I got a dedicated server for a project(angular/nodejs). I already configured centos web panel and through this, my domain with let's encrypt ssl, frontend and backend api and everything is up and running so far.
The backend api is running through jenkins/pm2 and it's up on my ip:port3333 but I need it to be ssl, so for example, I would need it to be https://api.example.com:3333 otherwise I'm getting this error on my project: This request has been blocked; the content must be served over HTTPS.
If I try https://example.com:3333 or https://subdomain.example.com:3333 i get an ERR_SSL_PROTOCOL_ERROR which i guess it's normal since centos web panel seems to apply only to the main domain.
So, how can I point a domain or subdomain to the service port 3333 and apply an ssl to it? Or if I can't, how should I proceed to get the service running with ssl? Do i really need this config serverside or is it a matter of the app.
Any idea on how to proceed? Not sure what config should I share.
Thanks in advance.
Turns out it was caused by a missconfiguration on my reverse proxy on apache to a custom port.

Is it possible to set up a VPN server on Debian 8 while keeping my web services (php/apache)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I would like to set up a VPN server, however it means ipv4 forwarding. Is it possible to set up a VPN without shutting down web services or should i use 2 separate servers ?
Thanks for reading ;)
Setting up a VPN server should not affect your web services. The only limitation is that you cannot use an HTTP(S) port (80 or 443), which I personally find practical (I have already seen Wi-Fi hotspots blocking all the ports except 80 and 443). However, if you get along with another port, you will do fine.
There is a good article about setting up an OpenVPN server on Debian Wiki (here). I have managed to set up the server using only this article.
Wishing you good luck.

Open 8080 port on my local server to public [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I'm really new to deployment, server management, etc. I'm built this internal dashboard website in my company in port 8080. Other co-workers would like to access my website remotely. Is there a way to open access to public just for port 8080? Please help.
That depends on how your network is built.
Basically, you have to forward the requests on the port 8080 from the main router connected to the internet to the IP and port of the server hosting the website. This way, every time a request is made to the public IP on the port 8080, the router forwards it to the local IP of the intended server.
If you provide more information about the network infrastructure maybe we could try to figure it out.
You have to access to Router Property (192.168.1.1) and configure NAT . Other co-workers can access to your website in this way -> publicIp:8080

Struggling with Amazon Route 53 DNS Management [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I purchased a domain through Amazon Route 53 and am hosting my Node.js/ExpressJS app on an Amazon Linux EC2 Instance server. I can get my site to run on my EC2 server by using the public IP:portNumber or by using the publicDNS:portNumber, but I am struggling to understand how to set up the record sets in the hosted zone section of the Route 53 console to have my website point to www.thedomainipurchased.com:portNumber. I also read somewhere that you can't add the port number onto the public ip like that, so I would like to know how to set up both records to do this. I'm new to DNS, which is why I've had such a hard time although I'm sure to some people this seems very simple so would really appreciate any feedback to be explained in as basic and simple of a way as possible. Record Set Picture here
DNS only provides a way to map names to the IP addresses of hosts. Except under very limited circumstances you can't include a port number. DNS simply isn't designed to do that.
Ports are determined by the protocol involved. If you use a web browser to connect via HTTP then it will default to using port 80. If you use a web browser to connect via HTTPS then it will default to using port 443. When you send e-mail the default port is 25. When you SSH into a server the default port is 22. And so on. Default ports are essentially part of the specification for the global internet.

Resources