Vue webpack proxy acts as an agent, prompting 504 (Gateway Timeout) all the time.

I am now using webpack to develop the project, but when I request a background interface, I will prompt for cross-domain, then take a look at the use of webpack"s devServer as a proxy, and then follow this, and find that the proxy has not been successful. Ask the gods for advice
this is my proxy configuration;

clipboard.png

:

clipboard.png

clipboard.png


this problem has been solved. When you need an agent locally, for example, the http://172.168.192.4:7003/portal/index.do interface
should be written like this
proxy: {

.
        '/**': {
            target: 'http://172.168.192.4:7003', 
            changeOrigin: true,
        
        }
    }
    axios baseURL='/portal';
    url/index.do

Agent No problem. Can I send other code?


I have the same problem. Have you solved it? Can you share


make sure your new service is open, and open the server by, node index, under the server folder.


I have the same problem. Have you solved it? Can you share


the server port number is changed to 80
'/ api': {

    target: 'http://xx.xx.com/',
    changeOrigin: true,
    pathRewrite: {
      '^/api': ''
    }
  },

API request api/aa/getBB

Menu