I used nginx as regular proxy server. However, it only works with http but not https. It returns an error page for the https requests.Is there a way to configure NGINX for it to bypass https?
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
resolver 114.114.114.114;
listen 8228;
server_name localhost;
location / {
proxy_pass $scheme://$http_host$request_uri;
proxy_set_header Host $http_host;
proxy_buffers 256 4k;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
You have to add new
server
location with https-related settings, this might do the job:There are lots of optional parameters for HTTPS configuration you must use on production for sufficient security, I've already described really good security configuration on github gist by link, also official documentation on ssl module is a good point for start.