这是我的 nginx 虚拟主机配置:
upstream demo {
server 127.0.0.1:9002 max_fails=250 fail_timeout=180s;
}
server {
listen 80;
server_name _;
root /home/web/public;
location /demo/ {
proxy_pass http://demo/;
}
location /demo/assets/ {
#this is where I need to point localhost/demo/assets (and all of it's subfolders) to another folder
#the line below obviously doesn't work
root /home/user/Workspaces/demo/public;
}
}
根文件夹指向/home/web/public
,但我需要 urllocalhost/demo/assets/
及其所有子文件夹才能转到另一个(外部)文件夹。我怎么做?
我正在运行 nginx 1.4.3