webman-admin部署的问题

chao

问题描述

https://www.workerman.net/doc/webman/others/nginx-proxy.html
按照webman这里进行部署访问前台是没有问题的,但是访问admin就会出现静态资源404的问题。

/app/admin/component/pear/css/pear.css net::ERR_ABORTED 404 (Not Found)
/app/admin/component/layui/layui.js?v=2.8.12 net::ERR_ABORTED 404 (Not Found)

使用下面的配置访问都正常,但是会暴露项目的文件,项目几乎所有文件都能被下载。

location ^~ / {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      if (!-f $request_filename){
          proxy_pass http://webman;
      }
}

按照webman系统能够自动把admin插件的静态资源代理过去的呀,插件里配置了public_path的。

return [
    'debug' => true,
    'controller_suffix' => 'Controller',
    'controller_reuse' => false,
    'public_path' => base_path('plugin' . DIRECTORY_SEPARATOR. 'admin' . DIRECTORY_SEPARATOR . 'public'),
    'plugin_market_host' => 'https://www.workerman.net',
    'version' => '0.6.33',
];

请问要如何正确的配置呢?

29 0 0
0个回答

🔝