Proxies are currently only working Dev but not in Build
See original GitHub issueEnvironment
------------------------------
- Operating System: `Darwin`
- Node Version: `v14.18.0`
- Nuxt Version: `3.0.0-27389502.88da719`
- Package Manager: `yarn@1.22.17`
- Bundler: `Vite`
- User Config: `alias`, `nitro`, `build`, `css`, `modules`, `proxy`, `vite`, `vue`, `hooks`, `components`, `privateRuntimeConfig`, `publicRuntimeConfig`
- Runtime Modules: `@nuxtjs/proxy@2.1.0`
- Build Modules: `-`
------------------------------
Reproduction
Here you can see a sample proxy working when the dev command is run but not working after a build and start https://stackblitz.com/edit/nuxt-starter-g2m6nk
Describe the bug
I have a few proxies setup that did work in Nuxt 2 with the @nuxtjs/proxy module. But now I am doing this with Vite and it does work in dev. But when I build or deploy to a test site none of my proxies work at all and I get a 404 page. I went ahead and installed the @nuxtjs/proxy module in my Nuxt 3 project and I get the same results in dev and build.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
proxy not working for create-react-app in production
Proxies are for development purposes only, and they are handled by webpack-dev-server . On production you need to make the calls to the ......
Read more >Docker run works behind proxy, and Docker build does not
It should run apt-get update/install and build the image. Additional information you deem important (e.g. issue happens only occasionally):. I have set in...
Read more >Working with HTTP Proxies | OpenShift Container Platform 3.11
If your Git repository can only be accessed using a proxy, you can define the proxy to use in the source section of...
Read more >What is a Proxy Server and How Does it Work? - Varonis
A proxy server acts as a gateway between you and the internet. Learn the basics about proxies with our complete, easy-to-follow guide.
Read more >How to use proxies with Python Requests Proxy Module - Zyte
Configuring and using proxies is not easy, especially when sending HTTP requests. Built-in modules like urllib, urllib2 help us deal with HTTP requests....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s someone’s code: https://github.com/nuxt/framework/discussions/1223#discussioncomment-1960448
@danielroe @lperez22
Could you please provide an example to proxy the api calls using that approach as I also wanted to try that approach before axios or proxy module is ready.
Thanks