Nginx nginx.conf 的配置
server {
listen 80; // 指的是监听的端口号,80是http协议的默认端口,443是https
server_name YOUR_IP; // 指的是你配好pod的域名或者IP地址
#ssl_certificate /etc/nginx/ssl/bobblehat.cn_bundle.crt; // 这是443才要的
#ssl_certificate_key /etc/nginx/ssl/bobblehat.cn.key; // 这是443才要的
location / {
root html;
index index.html index.htm; // 这俩都不用改
proxy_pass http://localhost:3000; // 这个是你项目起的地址。注意后面不要带 /
}
如果启动nginx失败了 提示80端口已经被使用了怎么办
$ netstat -ltunp // 查找谁在占用这个端口
$ kill PID