Nginx的alias的用法及与root的区别
root@leco:/local_path/image# ls2.pngrequest_path
root@leco:/local_path/image# pwd
/local_path/image
root@leco:/etc/nginx/sites-enabled# egrep -v '#|^$' default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /request_path/image/ {
alias /local_path/image/;
}
location / {
try_files $uri $uri/ =404;
}
}
root@leco:/etc/nginx/sites-enabled# /etc/init.d/nginx reload
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
页:
[1]