centos下的nginx安装和配置

配置

1.资源路径

2.默认首页地址 http://ip 访问index.html

资源都要放在/data/www 下

server {         listen       80 default_server;         listen       [::]:80 default_server;         server_name  _;         root         /data/www; 	         # Load configuration files for the default server block.         include /etc/nginx/default.d/*.conf;          location / { 	 	index index.html index.htm;         }          error_page 404 /404.html;             location = /40x.html {         }          error_page 500 502 503 504 /50x.html;             location = /50x.html {         }     }