首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UserFrosting Nginx资产-原始404

UserFrosting Nginx资产-原始404
EN

Stack Overflow用户
提问于 2019-05-12 12:14:56
回答 1查看 109关注 0票数 1

我使用的是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;}

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-16 11:06:53

下面的Nginx规则配置代码可以正确地解决上述问题。

✔在我的实际测试之后.

代码语言:javascript
复制
  ## 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 - Index
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56099156

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档