当前位置: 首页 > news >正文

Jenkins+Nginx+vue

安装nodejs

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

@echo off
xcopy C:\ProgramData\Jenkins\.jenkins\workspace\super_manage_vue\dist F:\java\www\super_manage_vue\ /s /e /y
echo 复制文件完成
exit

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

安装niginx
配置文件如下


#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   F:/java/www/super_manage_vue;index  index.html index.htm;}location /prod-api/ {proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://localhost:6517/;}#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;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  somename  alias  another.alias;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}

这样访问vue时,路径匹配prod-api就被Nginx反向代理到http://localhost:6517/;这个端口,这个端口是启动java后的端口。这样就能访问到java的接口。
在这里插入图片描述

http://www.lryc.cn/news/118961.html

相关文章:

  • 【vue 监听页面滑动到底部】
  • (一)创建型设计模式:2、单例模式(C++实现实例 线程安全)
  • 《练习100》86~90
  • C++——命名空间、输入、输出
  • 解锁滴滴ES的性能潜力:JDK 17和ZGC的升级之路
  • Permutation and Primes 2023牛客暑期多校训练营8 J
  • centos如何配置IP地址?
  • git clone 报错Filename too long
  • 【雕爷学编程】Arduino动手做(184)---快餐盒盖,极低成本搭建机器人实验平台3
  • redis String类型命令
  • Blazor 简单组件(0):简单介绍
  • 在vue3+vite项目中使用jsx语法
  • HCIA 路由器工作原理 及其 静态路由配置
  • 【Git】—— git的配置
  • [git] git基础知识
  • 【从零学习python 】15.深入了解字符串及字符集编码
  • 【LeetCode】打家劫舍||
  • 【Nginx】Nginx的重定向——location
  • 每日一题——滑动窗口的最大值
  • 【使用go开发区块链】之获取链上数据(03)
  • js 动态设置transformOrigin
  • docker使用tab无法自动补全命令
  • 既然jmeter也能做接口自动化,为什么还需要pytest自己搭框架?
  • Objective-C获取变量类型的方法
  • 相机可见区域,使用鼠标拖拽模型
  • Vue 2 与 Vue 3 的全面比较
  • Unity学习笔记--如何优雅简便地利用对象池生成游戏对象(进阶版)LRU + 对象池
  • 【Spring专题】Bean的声明周期流程图
  • C++实现俄罗斯方块(源码+详解)
  • 01:STM32点灯大师和蜂鸣器