Nginx server 模块
server { // 标识虚拟主机开始 listen 80; ## // 指定虚拟主机服务器端口 server_name localhost; // 指定 IP地址或者域名; 多个域名用空格分开 #charset koi8-r; // 网页默认的编码格式 #access_log logs/host.access.log main; // 虚拟主机的日志访问路径 main 日志输入格式; location / { // URL 匹配特定位置的配置 // location 支持正则表达式 也支持条件判断 也支持条件匹配 root html; // 默认目录 index index.html index.htm; // } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }
原文:http://www.cnblogs.com/sharesdk/p/7851692.html