我使用的是Nginx,而不是Apache。所以我需要一段Nginx代码来解决前端静态资源的加载问题。
我的问题类似于this,但我不是Apache。我没有在‘网络服务器-信任’文件夹中找到我想要的东西。
以下代码似乎不起作用。
位置~* .(png|gif|jpg|jpeg|svg|ico|css|js|woff|ttf|otf|woff2|eot)$ {索引index.php;try_files $uri $uri/成员/公共/资产-原始/成员/公共/索引.raw?$查询_string;}
发布于 2019-05-16 11:06:53
下面的Nginx规则配置代码可以正确地解决上述问题。
✔在我的实际测试之后.
## Begin - UserFrosting Caching static files
location ~* \/member\/.*\.(png|gif|jpg|jpeg|svg|ico|css|js|woff|ttf|otf|woff2|eot|json)$ {
index index.php;
try_files $uri $uri/ /member/public/index.php?$query_string;
}
## End - UserFrosting Caching static files
## Begin - Index
## for subfolders, simply adjust:
## `location /subfolder {`
## and the rewrite to use `/subfolder/index.php`
location /member/public/ {
index index.php;
try_files $uri $uri/ /member/public/index.php?$query_string;
}
## End - Indexhttps://stackoverflow.com/questions/56099156
复制相似问题