部分应用场景下要求服务器根据客户输入的二级域名地址自动访问不同的页面,比如一个服务器放置了不同的业务,商城.官网等多个业务,又不想一个个配置server, 网站目录结构入戏: html 网站根目录 mall 商城源码 www 官网源码 blog 博客源码 test 测试网站源码 有四个网站,按照以前的做饭需要4个server_name监控,但是使用nginx的二级域名泛解析可以轻松实现: 使用nginx的泛解析功能可以,如下配置即可: server { listen ; server_name
A path to the file is constructed by merely adding a URI to the value of the root directive. If a URI has to be modified, the alias directive should be used Syntax: alias path; Default: — Context: location Defines a replacement for the specified loca
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ // core 和 events 是核心模块 user nginx; // 模块 core 语法 user user [group] // 指定 nginx w