本文共 518 字,大约阅读时间需要 1 分钟。
Ubuntu14.04下的nginx配置(配置文件nginx.conf):
server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }1、上述配置中第一个location中的root指定与nginx同目录下的html目录,index指定默认的欢迎页面为index.html或index.htm。 2、error_page指定发生错误500 502 503 504后,转向的页面。50.html页面同样在html目录下。 3、第二个location形式为location = /50x.html,表示精准的匹配。 4、与server同级的可以有多个。
转载地址:http://bflvb.baihongyu.com/