配置文件
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80; #默认端口号
server_name localhost; #域名或者IP
location / {
root html; #默认访问资源的目录
index index.html index.htm; #默认访问目录下的资源名称
}
error_page 500 502 503 504 /50x.html; #错误页面
location = /50x.html {
root html;
}
}
重新加载配置文件,使配置立即生效
nginx -s reload