Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forward HTTPS traffic thru Nginx without SSL certificate

I want to use Nginx to expose my NodeJS server listening on port 443.

I don't want to manage the SSL certificate with Nginx. I would rather do that on the NodeJS server using the SNICallback option of https.createServer.

How do I setup the nginx.conf to support this?

like image 520
aleclarson Avatar asked Sep 25 '17 19:09

aleclarson


People also ask

How do I redirect traffic to HTTPS Nginx?

Redirect HTTP to HTTPS version for Specified domain in Nginx Server_name domain-name.com www.domain-name.com – it specifies the domain names. So, replace it with your website domain name that you want to redirect. Return 301 https://domain-name.com$request_uri – it moves the traffic to the HTTPS version of the site.

How do I use Nginx as an HTTPS forward proxy?

The following steps briefly outlines the process. 1) The client sends an HTTP CONNECT request to the proxy server. 2) The proxy server uses the host and port information in the HTTP CONNECT request to establish a TCP connection with the target server. 3) The proxy server returns an HTTP 200 response to the client.

Can Nginx act as forward proxy?

For example, Nginx and the Apache web server are both commonly used as a reverse proxy in enterprise architectures. These two pieces of software can be configured to act as a forward proxy as well.


1 Answers

You're looking for ssl pass-through. You'll set up your nginx to use TCP load balancing (even if you only have one server it's still thought of as load balancing) and ssl passthrough. Note that nginx will be unable to access any of the content and that you will lose almost all of the advantages of using a proxy other than the ability to do load balancing. See these instructions for a specific configuration example.

like image 90
Sam Hartman Avatar answered Sep 22 '22 14:09

Sam Hartman