利用Nginx实现域名转发 不修改主机头
2016-06-23 00:00
555 查看
在conf下 新建一个 文件 格式 : 域名.conf 例如:www.test.com.conf
文件里配置:
server
{
listen 80;
server_name www.test.com;
location /
{
proxy_pass http://www.81145.com/; }
}
然后在 :Nginx.conf 配置文件里 http块里添加:
include www.test.com.conf;
重启Nginx服务器就可以实现。
文件里配置:
server
{
listen 80;
server_name www.test.com;
location /
{
proxy_pass http://www.81145.com/; }
}
然后在 :Nginx.conf 配置文件里 http块里添加:
include www.test.com.conf;
重启Nginx服务器就可以实现。
相关文章推荐
- nginx使用小记
- nginx 502 错误
- keepalived高可用haproxy/nginx
- 使用Nginx代理thrift NIO实现SSL链路加密
- nginx按天切割日志
- 四:深入Nginx之事件和连接 (之三:连接池)
- Linux下定时切割Nginx访问日志并删除指定天数前的日志记录
- centos6安装nginx
- lvs、haproxy、nginx 负载均衡的比较分析
- nginx 配置全站404(百度闭站保护)
- nginx+fastcgi php 使用file_get_contents、curl、fopen读取localhost本站点.php异常的情况
- nginx编译安装
- 在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境
- 权限问题导致Nginx 403 Forbidden错误的解决方法
- Lnmp中nginx经常出现502错误解决方法
- nginx安装及配置
- 安装nginx并搭建nginx图片服务器
- nginx动静分离
- nginx安装
- Log POST Data in Nginx