配置本地开发机器虚拟域名以及泛域名解析
2018-04-07 00:00
387 查看
配置本地开发机器虚拟域名以及泛域名解析
适合在本地进行多站点开发配置
1、配置:C:\Windows\System32\drivers\etc\hosts
添加
2、nignx配置
作用说明:
在目录 D:/web/ 里添加 test虚拟目录站点,在hosts文件里 添加 test的二级域名映射如:127.0.0.1 test.a.la,刚可以通过 test.a.la 直接访问test站,不需求重启nginx
适合在本地进行多站点开发配置
1、配置:C:\Windows\System32\drivers\etc\hosts
添加
127.0.0.1 a.la 127.0.0.1 qwadmin.a.la 127.0.0.1 test.a.la
2、nignx配置
server { listen 80; #server_name test.a.la; server_name ~^(?<subdomain>.+).a.la$; index index.html index.htm index.php; root D:/web/$subdomain; location ~ \.php$ { root D:/web/$subdomain; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param domain $subdomain; include fastcgi_params; } }
作用说明:
在目录 D:/web/ 里添加 test虚拟目录站点,在hosts文件里 添加 test的二级域名映射如:127.0.0.1 test.a.la,刚可以通过 test.a.la 直接访问test站,不需求重启nginx
相关文章推荐
- PHP的Thinkphp5的apache服务器开发过程中的虚拟域名简化以及路由配置
- tomcat配置本地开发虚拟域名
- php本地虚拟域名配置 适用小白
- Ngrok配置外网域名-自定义域名和端口--小程序https本地开发必备
- mac下配置Apache虚拟域名方案,以及遇到的坑
- 本地apache配置虚拟域名
- apache本地虚拟主机配置(多域名,单IP)【转】
- vagrant box配置本地开发环境以及常见错误解决方案
- apache本地解析配置域名apache配置本地测试多网站域名与虚拟主机
- 本地vagrant配置虚拟域名的坑
- 本地机apache配置基于域名的虚拟主机
- nginx配置虚拟域名以及代理
- 配置apache虚拟主机具体步骤详解(配置虚拟域名指向本地主机)
- win7配置host添加本地域名测试以及代理和host共存的解决方案
- Java开发配置虚拟主机即更改我的项目域名
- win7配置host添加本地域名测试以及代理和host共存的解决方案 推荐
- apache、nginx的虚拟域名配置和rewrite配置,以及web缓存的几种方式
- Apache配置本地虚拟域名
- PHP本地实现虚拟域名访问:Apache虚拟主机配置
- apache的虚拟域名rewrite配置以及.htaccess的使用。