• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

手把手从0打造电商平台-前端开发 静态资源404

有没有买了这个电商前端课程的小伙伴? 我学了这个课程的后端,然后打算把前端代码直接拿来用,在部署服务器的时候出现了问题,在npm run dist之后,把dist目录放在服务器的/product/mall_frontend/mmall/下,然后配置nginx如下(zjxjwxk.com是我的域名,我用了https):
mall.zjxjwk.com.conf
server {        listen 443 ssl;        autoindex on;        server_name mall.zjxjwxk.com;        access_log /usr/local/nginx/logs/access.log combined;        index index.html index.htm index.jsp index.php;        ssl_certificate /root/.acme.sh/zjxjwxk.com/fullchain.cer;        ssl_certificate_key /root/.acme.sh/zjxjwxk.com/zjxjwxk.com.key;        ssl_trusted_certificate /root/.acme.sh/zjxjwxk.com/ca.cer;        if ( $query_string ~* ".*[\;'\].*" ){                return 404;        }        location = / {                root /product/mall_frontend/mmall/dist/view;                index index.html;        }        location ~ .*\.html$ {                root /product/mall_frontend/mmall/dist/view;                index index.html;        }        location / {                proxy_pass http://127.0.0.1:8080/;                add_header Access-Control-Allow-Origin *;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {                proxy_pass http://127.0.0.1:8080;                expires 30d;        }        location ~ .*\.(js|css)?$ {                proxy_pass http://127.0.0.1:8080;                expires 7d;        }}然后我访问我的网页的时候是访问不到css,js这些静态资源的
094002fivbkkiitslbyza8.jpg

094009r0xgs9xgn0kzfec7.jpg

这里报错显示访问的资源在https://mall.zjxjwxk.com/dist/ 下面,这好像不太对。因为资源并没有在根目录下,而是在/product/mall_frontend/mmall/dist/下面。
而看网页源码的时候,css访问的是/dist/css/下的文件
094017qhmptx9nzfxitpzi.jpg

本人对前端了解不多,但想完整构建一个电商项目,前端源码完全没有动过,求各位大佬指点有可能在哪出了错。

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!