因为是静态分离的,nginx处理静态文件,所以问题就在nginx配置文件中

将对应的css,js,图片信息也使用本地代理

oneinstack 部署项目时,静态文件不展示

 

 

server {
  listen 80;
  listen [::]:80;
  server_name shopping.kingsuper.net;
  access_log off;
  index index.html index.htm index.jsp;
  root /data/wwwroot/shopping.kingsuper.net;
  
  #error_page 404 /404.html;
  #error_page 502 /502.html;
  
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    proxy_pass http://127.0.0.1:8080;
    expires 30d;
    access_log off;
  }
  location ~ .*\.(js|css)?$ {
    proxy_pass http://127.0.0.1:8080;
    expires 7d;
    access_log off;
  }
  location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
    deny all;
  }
  location ~ {
    proxy_pass http://127.0.0.1:8080;
    include proxy.conf;
  }
        
}

 

相关文章:

  • 2021-11-19
  • 2021-09-12
  • 2022-12-23
  • 2022-01-07
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2021-10-09
  • 2022-01-22
  • 2021-07-13
  • 2021-09-01
  • 2022-12-23
  • 2021-10-05
相关资源
相似解决方案