Nginx前端代理发布

news/2024/7/20 3:30:30 标签: javascript, 小程序, nginx

1.vue中的config配置

const baseUrl="http://192.168.10.206:8092"
const VUE_APP_BASE_API = '/api'
 devServer: {
      disableHostCheck: true,
      port:8082,
      proxy: {
        [process.env.VUE_APP_BASE_API]: {
          target: baseUrl,
          changeOrigin: true,
          pathRewrite: {
            ['^' + process.env.VUE_APP_BASE_API]: ''
          }
        },
      },
  },

2.nginxnginx.conf配置

     location / {
            root   html;
            index  index.html index.htm  index.php;
        }
     location /api/ {
       rewrite ^/api/(.*)$ /$1 break;
       proxy_pass http://127.0.0.1:8092;  #机器ip
     }


http://www.niftyadmin.cn/n/822217.html

相关文章

string和整数转换

tostring(int) fromstring(string ) c11新方式 stodConvert string to double (function template )stoldConvert string to long double (function template )stoiConvert string to integer (function template )strtofConvert string to float (function )转载于:https://ww…

做一个有脑子的程序员

程序员是最理性的一个群人,除非面对电子产品的时。程序员是一群高智商的群体,唯一的缺点就是发际线总是很难防守。程序员是一群情商比较低的人群,常常看到程序员仅仅因为对技术的理解不同而大吵起来。程序员常常是一群豁达的人,今…

hihoCoder 1393 网络流三·二分图多重匹配 (网络流学习#3 记录)

题目链接&#xff1a;http://hihocoder.com/problemset/problem/1393 话说我之前一直不知道二分匹配可以用网络流做。。。 #include<cstdio> #include<cstring> #include<queue> using namespace std; const int N205; struct ss{ int v,c,nxt; } e[N*20]; i…

关于引入第三方页面

有这么一个需求&#xff0c;有一个外部业务系统需要引用我们现在的项目&#xff0c;他们传一个code值&#xff0c;我们通过code值判断是否需要进入登录页面。 我这边主要处理&#xff1a; 1.在路由卫士router.beforeEach中判断 to.query.code是否有值&#xff0c;有值则跳到指…

怎么录屏_电脑录屏怎么录?屏幕录制要点须知

在我们生活中&#xff0c;在电脑上浏览的时候总是会碰到许多无法下载的视频&#xff0c;而这个时候我们又特别想把它给保存下来&#xff0c;那我们怎么办呢&#xff1f;我们可以选择录屏的操作&#xff0c;把自己想要留存的视频把它直接在电脑上给录制下来便可以了&#xff01;…

中国互联网公司开源项目调查报告:BAT们谁是开源王者?

作者 | 徐川、覃云 近年来&#xff0c;开源技术得到越来越多的重视&#xff0c;微软收购 GitHub、IBM 收购红帽&#xff0c;都表明了开源的价值。国内公司也越来越多的参与开源&#xff0c;加入开源基金会 / 贡献开源项目。但是&#xff0c;它们到底做得如何呢&#xff1f;为此…

mosquitt win32

软件 mosquitto-1.4.10-install-win32.exe. 安装时候提示下载后面两个。win32openssl一定是1_0_1&#xff0c;否则没有需要的dll文件。 pthreadVC2.dll Win32OpenSSL_Light-1_0_1u 发送消息&#xff1a; mosquitto_pub -h m2m.eclipse.org -p 1883 -t "com/a/zhibin"…

向sap发送message_如何实现采购订单发送提醒,催促信(Reminder, dunning ME91F)

SAP 系统是如何对 output type MAHU 处理 , 实现采购订单的向供应商发送 reminder / dunning letter .在我们去实现新的output type 除了拷贝系统标准 MAHN , 还需要以下配置 :分配FORM routine and FORM通过 M/36 将message type 分配到 Procedure RMBEF1MN04 将message type …