簡體   English   中英

如何使用直接 url 訪問 node.js 站點而不在 aws ubuntu、ZA03019356A9286EZ466 中提及端口 8080

[英]How to access node.js site with direct url without mentioning port 8080 in aws ubuntu, Apache2

我的 node.js 應用程序在端口 8080 上運行。我想通過 url 訪問它,而無需在 URL 中提及端口號。 我將如何實現這一目標?

例如:當前:www.domainname.com:8080

預期:www.domainname.com

Ubuntu 操作系統版本:16 服務器:Apache2

需要幫忙。

使用 Nginx 作為您的節點 js 應用程序的反向代理,並在 nginx 配置文件中提及您的端口。(您可以創建新的配置文件,也可以使用默認的 /etc/nginx/nginx.conf)

安裝 pm2 並使用 pm2 工具在后台繼續運行您的 nodejs 應用程序。

curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install -y nodejs
sudo npm install pm2@latest -g

pm2 start myapp.config.js (replace myapp.config.js with YOURAPP.js )

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM