question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy not working

See original GitHub issue

Hi,

I’m using the following configuration, and running webpack-dev-server --content-base public

  proxy: {
    '/api/*': {
      target: 'http://localhost:4907',
      rewrite: function(req) {
        console.log(req)
        req.url = req.url.replace(/^\/api/, '');
      }
    }
  },

All requests e.g. /api/user/current have a 404 response, and my console.log never fires. Is there some other part of the config that I’d need to change?

Thanks, Chris

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

19reactions
johnhammcommented, Jan 10, 2017

Just incase anyone else is running into this issue - the PHP standalone server also requires “[::1]” instead of localhost:

proxy: [
           {
               path: '**',
               target: 'http://[::1]:3000',
               secure: false
           }
       ]
13reactions
karl-gustavcommented, Oct 2, 2017

We got 404 from azure api servers, and we solved it by adding changeOrigin: true to our proxy config.

"/api": {
    target: "https://devapi.example.com",
    secure: false,
    changeOrigin: true
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Connect to Proxy Server in Windows 10
Unable to Connect to Proxy Server in Windows 10 · 1. Disable Proxy Settings · 2. Reset Internet Options · 3. Clear Browser...
Read more >
How to Fix “There Is Something Wrong With the Proxy ...
Go to the Control Panel. · Click on Internet Options. · Click on LAN (Local Area Network) Settings. · Uncheck the box that...
Read more >
FIX: Unable to Connect to proxy server in Windows 10/11
How can I fix Unable to connect to proxy server? · 1. Reset Internet options · 2. Disable proxy · 3. Use a...
Read more >
Guide to Solving Proxy Status Errors
How to fix: Fixing this issue is simple. You need to update your proxy server settings by including whitelisted IPs and use appropriate ......
Read more >
How to fix "There is something wrong with the proxy server ...
Method 3: Checking your Proxy Settings · On your keyboard, press Windows Key+S. · Type “control panel” (no quotes), then hit Enter. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found