zoukankan      html  css  js  c++  java
  • 前后端打包+nginx报错问题汇总

    0 环境

    • 系统环境:win10
    • 数据库:mysql
    • 后端IDE: IDEA
    • 前端IDE:vscode
    • 转发:nginx

    1 前言

    参考视频

    2 问题解决

    • idea(后端)打包报错
    打包
    打包

    报错 idea 报 Cannot access alimaven (http://maven.aliyun.com/nexus/content/groups/public/) in offline mod

    取消work offline勾选
    取消work offline勾选
    • vue(前端)打包

    vue run build

    • nginx转发

    目标:浏览器输入xxx:8088端口通过nginx请求转发到xxx:8087这个端口上

    大概流程
    大概流程

    nginx.conf配置

    server {
      # 监听地址
            listen       8088;
            server_name  127.0.0.1;

            #charset koi8-r;

            #access_log  logs/host.access.log  main;


            location ~ .*.(js|css|ico|png|jpg|eot|svg|ttf|woff|html|txt|pdf|) {
               #所有静态文件直接读取硬盘
               root   html/dist/;
               index  index.html index.htm;
               expires 30d; #缓存30天
            }

            location / {
                # 跳转到后端的ip地址
                proxy_pass http://127.0.0.1:8087/;
                proxy_redirect default;
            }

            #error_page  404              /404.html;

            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    }

    3 小结

    前后端分离上线总结 可能图太大需要点击链接查看

    作者:以罗伊
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文链接,否则保留追究法律责任的权利。
  • 相关阅读:
    《杜教筛》
    《洛谷P4213 【模板】杜教筛(Sum)》
    《洛谷P1829 [国家集训队]Crash的数字表格 / JZPTAB》
    《纸牌问题》
    《洛谷P2522 [HAOI2011]Problem b》
    使用urlretrieve下载图片
    scrapy初探
    爬豆瓣电影名
    直接插入排序
    Windows python 3 安装OpenCV
  • 原文地址:https://www.cnblogs.com/my-ordinary/p/13625645.html
Copyright © 2011-2022 走看看