nginx部署vue应用与spring-boot后台

人人开源框架实战:从零搭建企业级后台管理系统 本文详细介绍了如何使用人人开源框架快速搭建企业级后台管理系统。通过Spring Boot + MyBatis Plus技术栈和完整的前后端分离架构,人人开源框架显著提升了开发效率,特别适合中小型企业和内部管理系统。文章包含环境配置、项目初始化、前后端联调、代码生成器高级用法以及生产环境部署建议等实战内容。 阅读详情
前言

之前写过一篇关于nginx部署spring-boot的文章,这次再加上前端vue的部署,这样也算是整整齐齐了。

之前文章指路:阿里云CentOS-Nginx子域名转发-https访问-SpringBoot使用jar包部署一套完成!

添加子域名
  1. 登录云解析控制台
  2. 在主域名下添加记录解析即为子域名
  3. 这次分别是两个,一个是vue的(xinqiao.nevercome.net),还有一个是spring-boot的(xinqiaoapi.nevercome.net)
vue的打包

vue的打包要注意两点:

1 publicPath

publicPath虽然说是可以带子路径的,就比如说你用tomcat来部署,放在了webapps里面,那么目录的名称就是访问路径的子路径,比如说(www.nevercome.net/xinqiao)但是这里面有不少坑点,这和vue-router有点不太搭,如果vue-router的路由是后台动态拉取的总是会把配置的子路径给吞掉,目前我也没有找到好的处理方式,那么最好就是避免带上子路径,而且带着子路径的访问域名也不好看,远不如二级域名来得简洁直观。

也就是说理论上可以这样:

module.exports = {
   
   
  // 部署生产环境和开发环境下的URL。
  // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
  // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl(publicPath) 为 /admin/。
  publicPath: process.env.NODE_ENV === "production" ? "/xinqiao/" : "/",
  
  utputDir: 'dist'
  // others...
}

但最好还是这样,以避免vue-router的bug

module.exports = {
   
   

  publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
  
  utputDir: 'dist'
  // others...
}

2 axios的baseURL

在开发环境下,也就是npm run dev,webpack是会提供一个devServer的,它可以根据配置来转发请求。就比如说这样子的配置:

devServer: {
   
   
    host: '0.0.0.0',
    port: port,
    proxy: {
   
   
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.</
Vue3+ElementPlus+vite 设置全局样式修改 安装插件 unplugin-auto-import。vite.config.js中修改。 阅读详情

相关推荐

Spring Boot Vue Element入门实战 十七、Nginx+Tomcat前后端部署

本博客属作者原创,未经允许禁止转载,请尊重原创!如有问题请联系QQ509961766 (一)打包 注意:打包前注意修改各种ip,例如http请求的ip,数据库连接ip,redis连接Ip等等,如果都是本机的话就是localhost,如果是云服务器就改成公网地址,内网就是局域网ip vue打包就是cd进入user工程目录下,然后输入命令npm build就可以了,idea的话直接在term...

常年被追砍的博客 343

Spring Boot Vue Element入门实战(十七)Nginx+Tomcat前后端部署

本博客属作者原创,未经允许禁止转载,请尊重原创!如有问题请联系QQ509961766 (一)打包 上一篇:Spring Boot Vue Element入门实战(十六)菜单首页,前后台整合 下一篇:Spring Boot Vue Element入门实战(十八)完结 点击这里返回目录 源代码下载 Github: https://github.com/Iamoldwang/spring-boot-...

岁月不饶人,我亦未曾饶过岁月 1601

PADS Layout新手必看:从元件摆放到地线处理的10个实用技巧

本文为PADS Layout新手提供了10个实用技巧,涵盖元件摆放、地线处理等关键环节。从功能模块化布局到高频信号处理,再到电磁兼容性设计,帮助初学者快速掌握PCB设计核心技能,提升Layout效率和质量。特别适合需要优化PADS Layout工作流程的设计师参考。

stone的博客 261

从飞机翼型仿真到燃烧模拟:Fluent多物理场耦合的3种实战策略

本文深入探讨了Fluent在多物理场耦合仿真中的三种实战策略,涵盖可压缩流动与燃烧耦合、湍流模型选择及网格策略,以及顺序耦合、强耦合和混合耦合方法。通过具体案例和工程实践,帮助中高级用户提升仿真精度和效率,适用于航空航天和能源化工等领域。

aa123的博客 1003

LCD工程师必看:Pixelclock、Mipi Clk计算全解析(附实用公式)

本文为LCD工程师详细解析了像素时钟(Pixelclock)与MIPI时钟(Mipi Clk)的核心计算方法。文章从时序参数构成入手,通过实战公式推导,系统阐述了从屏幕分辨率、刷新率到最终MIPI速率的高效计算链路,并提供了实用的调试思路与排查清单,帮助工程师快速解决画面撕裂、闪烁等常见问题。

weixin_29266679的博客 405

Fedproto:原型聚合的联邦学习框架

文中说明,联邦学习通过计算传递梯度聚合模型时,客户端之间的异构性通常会阻碍模型优化收敛和泛化性能。故本文提出新的FedProto框架,将梯度替换成为原型,通过计算、聚合从不同客户端收集到的本地原型,然后将全局原型发送回所有客户端,以规范本地模型的训练。对每个客户机进行局部训练的目的是最小化对本地数据的分类损失,同时保持生成的本地原型足够接近相应的全局原型(损失函数最小+正则)。什么是原型?文中提到:“

weixin_47754029的博客 2654

深度学习环境配置系列文章(二):Anaconda配置Python和PyTorch

Anaconda有着强大的包管理和环境管理的功能,使用后可以方便地使用和切换不同版本的Python和PyTorch等科学计算库,本文将介绍其下载安装和使用方法。第二章和第三章内容分别提供Window系统和Linux系统安装Anaconda的方式,读者可根据自己电脑系统选择其一安装即可。

极光喵的博客 4185

2025年最新自动化/控制保研夏令营&预推免面试真题分享(东南大学苏州校区/华东理工/南航/天大)

笔者来2021级本科自动化专业,以下部分将介绍我在夏令营以及预推免期间发生经历和问题。

Control Everything 2587

45 - Android系统源码-crosvm 实战:基于 KVM 的 Rust 安全虚拟机监控器核心技术

摘要:crosvm 是 Google 开发的基于 KVM 的轻量级虚拟机监控器(VMM),采用 Rust 语言编写,专为 ChromeOS 和 Android 设计。其核心特点包括: 安全架构:通过 Rust 的内存安全特性和多进程隔离(每个设备运行在独立沙箱进程)大幅降低攻击面 性能优化:基于 KVM 的硬件虚拟化支持,结合异步 I/O (io_uring/epoll) 实现高效设备模拟 模块化设计:清晰的 trait 抽象层(Hypervisor/Vm/Vcpu)支持跨平台扩展 Android 集成

保持专注,保持热爱 230

图像拼接(Image Stitching)

图像拼接(Image Stitching):是一项计算机视觉技术,它将多张重叠的图像合并为一张更大、无缝的全景图或广角视图。该技术广泛应用于全景摄影、地图制作、医学影像处理、计算机视觉及增强现实(AR)等领域。

📷 图像处理践行者 | 传统算法 · 深度学习 · 多模态 | 分享实战经验与技术洞见,探索从像素到智能的无限可能。 2513

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

上一篇: 【成为架构师3-20】章节小结:千万流量,这些技术就够了:服务化、数据库、缓存
下一篇: 【水贴】nodejs的版本问题造成的奇怪bug
Nevercome_
博客等级 码龄9年 27粉丝 66原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址