首頁  >  問答  >  主體

nginx如何隱藏一個資料夾?

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

#但是程式中的靜態目錄是在www/static

也就是說在請求的時候要 domain/www/static/xxxx.jpg才能存取到

怎麼把www隱藏掉?

阿神阿神2713 天前381

全部回覆(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
  • 取消回覆