我在网站的子文件夹中有一个静态应用程序:
URL: https://example.com/application
Files:
/home/username/web/application/public/index.html
/home/username/web/application/public/css/style.css
...
如何设置适当的“locatin”以访问public
文件夹下的静态文件?
我尝试过但没有成功:
location /application/ {
/home/username/web/application/public;
index index.html;
}
location ^/application/(.*)$ {
alias /home/username/web/application/public/$1;
index index.html;
}
答案1
尝试这个
location /application {
alias /home/username/web/application/public;
index index.html;
}