目 录CONTENT

文章目录

通过备案的域名访问,不需要添加端口号(nginx反向代理,直接域名访问)

懿曲折扇情
2022-04-23 / 0 评论 / 1 点赞 / 346 阅读 / 445 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-05-07,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
广告 广告

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

image-1650724317602

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 {
        }
    }

image-1650723532080

3.重启nginx服务

cd /usr/sbin
./nginx -s reload

image-1650723602412

4.修改成功

image-1650723821166

1

评论区