内部开发域名配置

1.线上要配置一个nginx的配置

server{
        listen 80;
        server_name online.feiniu.com;
        index index.html index.htm index.php admin.php;
        root  /home/wwwroot/default/feiniu/cow/Public;

        #error_page   404   /404.html;
        #include enable-php.conf;
        include enable-php-pathinfo.conf;
        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.
        {
            deny all;
        }

        access_log  /home/wwwlogs/access.log;
}

这里的online.feiniu.com就是一个假的域名。其实并没有域名指向它。

2.再在自己的电脑中配置一个hosts。

# 内部模拟
xxx.xxx.xxx.xxx online.feiniu.com

其中xxx.xxx.xxx.xxx为线上的ip。

配置好之后,就可以局部模拟开发了。

后记:
实践证明,并不好用。

会出现未备案。

原文地址:https://www.cnblogs.com/jiqing9006/p/9443846.html