nginx 一个站点支持多端口配置

版权声明:http://zhuijuwu.com 追剧屋 - 影视资源汇总搜索站点 https://blog.csdn.net/u013372487/article/details/79727732
server
    {
        listen 80;
        listen 8081; # 只需要配置多个listen即可
        server_name xxx.xxxxx.xx;
        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }
        access_log  off;
        error_log /dev/null crit;
    }

注意上面配置好后可能由于linux系统禁止了指定端口访问,导致配置的端口无法访问,此时只需开启该端口权限即可;

若使用阿里云ecs实例,需要到该实例安全组修改配置规则。

猜你喜欢

转载自blog.csdn.net/u013372487/article/details/79727732