search

Home  >  Q&A  >  body text

How to hide a folder in nginx?

The web root directory is in root "/phpstudy/www/xxx";

But the static directory in the program is www/static

That is to say, domain/www/static/xxxx.jpg must be accessed when requesting

How to hide www?

阿神阿神2863 days ago491

reply all(1)I'll reply

  • 天蓬老师

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

    Configuration

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

    Use alias to map a virtual directory.

    Visit address http://[ip]/phpstudy/static/a.txt

    reply
    0
  • Cancelreply