美文网首页
使用nginx配置二级域名

使用nginx配置二级域名

作者: 业余的猫 | 来源:发表于2019-05-31 11:23 被阅读0次

首先在域名提供商配置域名解析记录

*.ron.pub //使用*代替

编辑配置文件

vi /etc/nginx/conf.d/default.conf #我的系统是CentOs,其它系统自行查找配置文件路径

修改为以下内容

server {
    listen       80;
    server_name  draw.ron.pub; #你的子域名
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://localhost:8080; #配置地址
    }
}
#多个子域名,直接拷贝 server { ..... }

相关文章

网友评论

      本文标题:使用nginx配置二级域名

      本文链接:https://www.haomeiwen.com/subject/pikwtctx.html