使用nginx搭建静态资源服务器
原创
©著作权归作者所有:来自51CTO博客作者wx62ca408a2c56b的原创作品,请联系作者获取转载授权,否则将追究法律责任
- 安装nginx服务器
yun install nginx
- 启动nginx
nginx start
- 查看配置文件
nginx -h
-?,-h : this help
-v : show version and exit
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
fifdsafdsa
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/share/nginx/)
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
-g directives : set global directives out of
- 修改配置, 设置root默认静态资源路径
/home/xxx/static
,但是访问403 - 修改user 为root
- 重启nginx服务
nginx -s reload