账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    [HPM] Error occurred while trying to proxy request
    • 2018-02-09 00:00
    • 11
    101
    0

    最近在用vue+express+mongodb搭建项目,服务器这边是搭好了,但在前端请求的时候报服务器端错误504
    我直接访问127.0.0.1:3000都能获取数据;

    服务器报错:[HPM] Error occurred while trying to proxy request /goods from 127.0.0.1:8080 to http://127.0.0.1:3000/goods
    这是index.js代理配置:

    proxyTable: {
          '/goods': {
            target:'http://127.0.0.1:3000/goods',
            changeOrigin:true,
            pathRewrite:{
              '^goods':''
            }
          }
        }

    这是前端请求:

    http:function () {
          this.$axios.get('/goods').then((req,res)=>{
            let data = res.data;
            if(data.status === "0"){
              this.usurInfo = data.result;
            }else {
              this.usurInfo = [];
            }
          })
        }
    1
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 共 0 条
    • 低吟ぃ浅唱 普通会员 1楼

      The error message "Error occurred while trying to proxy request" typically indicates that there is an issue with the proxy settings or the proxy server itself. Here are some possible causes and solutions:

      1. Proxy settings: Make sure that you have correctly configured the proxy settings in your browser. Check that the proxy server name, port number, and protocol are correct. Also, ensure that you have enabled proxy support in your browser.

      2. Proxy server issues: Check if the proxy server is up and running. If it is down, try accessing the website again later. If it is still down, you may need to contact the proxy server administrator for assistance.

      3. Firewall settings: Check if your firewall is blocking requests to the proxy server. If it is, temporarily disable it to see if the error goes away.

      4. Clear browser cache: Clearing the browser cache can sometimes resolve proxy-related issues. Try reloading the browser.

      5. Update browser: Make sure that your browser is up to date with the latest security patches and features.

      If none of the above solutions work, you may need to contact the support team of the website you are trying to access for further assistance.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部