首页  >  问答  >  正文

nginx如何隐藏一个文件夹?

web根目录是在root "/phpstudy/www/xxx";

但是程序中的静态目录是在www/static

也就是说在请求的时候要 domain/www/static/xxxx.jpg才能访问到

怎么把www隐藏掉?

阿神阿神2713 天前374

全部回复(1)我来回复

  • 天蓬老师

    天蓬老师2017-05-16 17:15:54

    配置

    location /phpstudy/static/ {
        alias /usr/local/nginx/html/phpstudy/www/static/;
    }       

    使用alias映射一个虚拟目录即可。

    访问地址 http://[ip]/phpstudy/static/a.txt

    回复
    0
  • 取消回复