前端https代理

  proxy: {
        '/api': {
          target: env.VITE_API_BASE_URL, // 环境变量
          changeOrigin: true,
          rewrite: (path) => path.replace('/api/', '')
        },
        '/upfile': {
          target: 'https://111:222/', // 环境变量
          secure: false,// 允许HTTPS服务器证书

          changeOrigin: true, // 改变源到代理服务器

          rewrite: (path) => path.replace('/upfile/', '')
        }
      }

posted @ 2024-06-03 15:51  全琪俊  阅读(1)  评论(0编辑  收藏  举报