美文网首页
nginx使用记录

nginx使用记录

作者: 蘩_8065 | 来源:发表于2021-04-29 10:50 被阅读0次

查找nginx配置文件位置

find /|grep nginx.conf

编辑nginx配置文件

vim /usr/local/nginx/conf/nginx.conf

指定nginx配置文件

usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

重新加载nginx

/usr/local/nginx/sbin/nginx -s reload

开启目录并支持汉语路径

    server {
        listen 80;
        server_name localhost;
        charset utf-8;#支持汉语路径
        location   /static {
                root /tmp ;
                index readme.md;
                autoindex on;#开启目录展示
                autoindex_exact_size off;#显示文件大小
                autoindex_localtime on;#显示更新时间
         }
    }

相关文章

网友评论

      本文标题:nginx使用记录

      本文链接:https://www.haomeiwen.com/subject/wxgirltx.html