Wednesday, June 22, 2022

Set up Nginx Reverse Proxy pointing to https traffic

 vi /etc/nginx/nginx.conf

.
.
.
server {
        listen       8118;
        listen       [::]:8118;
        server_name  _;


        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256';

        location / {
                root /;
                proxy_connect_timeout       600;
                proxy_send_timeout          600;
                proxy_read_timeout          600;
                proxy_ssl_server_name on;
                send_timeout                600;

                proxy_pass https://target.com;
        }
}


Related command
=============
vi /etc/nginx/conf.d/default.conf
nginx -t
systemctl enable --now nginx
sudo systemctl stop nginx-debug
openssl s_client -connect www.target.com:443

 

Reference:
========
https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

No comments:

Post a Comment