您的位置:首页 > 运维架构 > 网站架构

阿里云网站部署(三):子域名解析

2017-10-10 13:54 211 查看
需求:在备案域名qwe.com的基础上,主域名www.qwe.com

         输入123.qwe.com 解析到另外服务器1.2.3.2的8081端口

重要的前提是:备案成功后在阿里云做域名的泛解析,参照阿里云网站部署(一)
 
[root@i~]# vim/etc/nginx/conf.d/123.conf 
////扩展配置子域名
      
server{
             
listen80;
      
server_name123.baidu.cn;
      
indexindex.html index.jsp index.php
      
proxy_set_headerHost $host:server_port;
      
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
      
proxy_set_headerX-Real-IP $remote_addr;
      
proxy_set_headerREMOTE-HOST $remote_addr;
      
location/ {
      
proxy_passhttp://1.2.3.2:8081/;
       }
 
}
[root@i~]#systemctl restart nginx
[root@i~]#systemctl enable nginx
 
 
 
验证:网页输:123.qwe.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐