Answer the question
In order to leave comments, you need to log in
How to declare a default port and not add it to the URL?
A remote server with Ubuntu was raised on DigitalOcean, node.js was installed and a test application was launched.
The problem is that you can reach the server only by adding the port to the URL, i.e. http://111.11.111.111:8080
. I, therefore, need to declare port 8080 by default in the server settings. How it's done?
Answer the question
In order to leave comments, you need to log in
We put nginx and listen to it on the 80th port, our incomprehensible garbage, which node.js is, hang on ::1 and only on it on any convenient port, make the nginx config like
server {
listen 80;
server_name nodejsdermo.gov.no
location / {
proxy_pass http://localhost:8080;
}
}
Where nodejsdermo.gov.no is the name of the server you are accessing, and 8080 is the port on which you are running your marginality. It is possible that it is still worth passing headers about the client's IP address to your bullshit, but google how to do it without me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question