84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
现在是这种情况1.vps上的博客已经搭建好了,用的是express,后台服务常驻,监听3000端口2.购买了域名,设置好了解析。3.通过www.example.com:3000和107.107.107.107:3000(举个例子吧)都能访问主页。
那么怎样做才能 输入www.example.com后就能直接访问主页内容呢?
光阴似箭催人老,日月如移越少年。
Listen directly to port 80, or use other software (nginx, apache, etc.) to act as a proxy on port 80
Thank you for the invitation. This question should be available on Baidu, keyword:
apache port forwarding
nginx port forwarding
In addition, if you are not using port 80, you can directly set up listening port 80.
means that my blog also uses express and listens to port 3000. It can be used directly after domain name resolution. . . http://charten.ml
Thank you for the invitation. Install Nginx, and then use proxy_pass to reverse proxy to localhost:3000.
proxy_pass
localhost:3000
nginx reverse proxy
Use nginx to listen to port 3000 and forward the request to your server
The answer has been mentioned above. I think iptable port forwarding should work without nginx. You can try it!
The default HTTP port is 80. When the domain name does not specify a port, port 80 is usedSo you can just listen to 80
——Or do you mean that your server cannot use port 80, or it is occupied by other processes?
Just listen to port 80, which is the default port number of HTTP
Http accesses port 80 by default, there are two solutions
One is to directly access the port number. For example, for port 8080, use hello.com:8080 to access
Another method that a friend mentioned before is to set up a reverse proxy, such as the famous nginx and apache.
From your question, I think you can take a look at the reverse proxy mode of nginx, search it on Baidu or Google:
Nginx reverse proxy
There are usually many answers
Listen directly to port 80, or use other software (nginx, apache, etc.) to act as a proxy on port 80
Thank you for the invitation.
This question should be available on Baidu, keyword:
apache port forwarding
nginx port forwarding
In addition, if you are not using port 80, you can directly set up listening port 80.
means that my blog also uses express and listens to port 3000. It can be used directly after domain name resolution. . .
http://charten.ml
Thank you for the invitation.
Install Nginx, and then use
proxy_pass
to reverse proxy tolocalhost:3000
.nginx reverse proxy
Use nginx to listen to port 3000 and forward the request to your server
The answer has been mentioned above. I think iptable port forwarding should work without nginx. You can try it!
The default HTTP port is 80. When the domain name does not specify a port, port 80 is used
So you can just listen to 80
——Or do you mean that your server cannot use port 80, or it is occupied by other processes?
Just listen to port 80, which is the default port number of HTTP
Http accesses port 80 by default, there are two solutions
One is to directly access the port number. For example, for port 8080, use hello.com:8080 to access
Another method that a friend mentioned before is to set up a reverse proxy, such as the famous nginx and apache.
From your question, I think you can take a look at the reverse proxy mode of nginx, search it on Baidu or Google:
There are usually many answers