注意:前提是公网域名通过备案和域名解析

1.安装nginx
yum install -y nginx
2.找到安装nginx.conf文件
server {
listen 80;
listen [::]:80;
server_name xxx.com.cn;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
# root html;
# index index.html index.htm;
proxy_pass http://101.43.39.xx:8090;
}
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

3.重启nginx服务
cd /usr/sbin
./nginx -s reload

4.修改成功

评论区