Closed chrisnoden closed 1 year ago
Also tried the "global" npm config set strict-ssl=false
before running nuxt dev, but nothing seems to clear the above problem only affecting the proxy
what does the proxy config look like?
config:
proxy: {
proxies: {
'/image': {
target: process.env.SERVER_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/image/, '')
},
}
},
the env can either be an IP or a hostname or a locally proxied hostname
https://127.0.0.1:8000/api
or https://localcert.dev:8000/api
or https://localcert.dev/api
However, if I use a service such as ngrok, it's fine:
env value would be something like https://4cff-194-35-99-18.ap.ngrok.io/image
Try using secure: false
In the proxy's options
That works. Thanks. I didn't spot that in the code when I tried to look for any undocumented options. It would be good to bring that option forward.
@chrisnoden this module uses https://github.com/refactorjs/http-proxy which is a refactor of https://github.com/http-party/node-http-proxy while trying to get rid of the bugs it incorporates and features that were left unused in pull requests.
When testing locally, my target (back-end) server is running with a self-signed cert.
Even when I start nuxt with
NODE_TLS_REJECT_UNAUTHORIZED=0
the proxy fails to connect to the back-end server: