Proxing to local https server with self signed cert
See original GitHub issueExpected behavior
just proxing requests to the api.
Actual behavior
I get 404 response when insecure proxy is set to the existing resource
Setup
- http-proxy-middleware: 0.9.1
- server: browser-sync: 2.15.0
proxy middleware configuration
var proxyMiddleware = require('http-proxy-middleware');
var proxyURL = 'https://portal.dev'; //this is my dev env, running on docker
var authProxy = proxyMiddleware('/rest', {target: proxyURL, secure: false, logLevel: 'debug'});
server mounting
browserSync.init({
logLevel: "debug",
https: true, //also tried while it was set to false
server: {
baseDir: outputDir,
middleware: [authProxy]
}
});
the logs
[HPM] Context match: "/rest" -> "/rest/version"
[HPM] Proxying "/rest/version": "undefined" -> "https://portal.dev"
the chrome console log:
Failed to load resource: the server responded with a status of 404 (Not Found)
the proxy itself setting is ok, if I change to:
var authProxy = proxyMiddleware('/rest', {target: proxyURL, secure: true, logLevel: 'debug'});
then I get different error which is expected:
[HPM] Context match: "/rest" -> "/rest/version"
[HPM] Proxying "/rest/version": "undefined" -> "https://portal.dev"
[HPM] Proxy error: SELF_SIGNED_CERT_IN_CHAIN. localhost:3000 -> "portal.dev/rest/version"
just to make sure it should work
$ curl https://portal.dev/rest/version --insecure
{"version":"82859f14"}
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
cameronhunter/local-ssl-proxy - GitHub
GitHub - cameronhunter/local-ssl-proxy: Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.
Read more >How to use HTTPS for local development - web.dev
What you need to do is to create a certificate and sign it with a CA that is trusted locally by your device...
Read more >How To Create a Self-Signed SSL Certificate for Nginx in ...
In this guide, we will show you how to set up a self-signed SSL certificate for use with an Nginx web server on...
Read more >Apache reverse proxy with self-signed certificate - Server Fault
a. SSLProxyCACertificateFile is for the httpd<->tomcat connection and contains the Public Key of the Tomcat Server's self-signed cert. b.
Read more >Reverse proxy and self-signed certificate - Caddy Community
Two servers Server A Caddy v2.4.6 FQDN with Let's Encrypt TLS certificate reverse proxy to server B on port 881 Server B Caddy...
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
we found it.
ignorePath
has to be set to false.thanks for Your interest. 😉
I also tried with webpack-dev-server (with http-proxy-middleware updated), which also uses http-proxy-middleware
configuration:
log:
same stuff in the browser I see that resource was not found, erorr 404.