Https nginx set up service in the environment, the local agent to web projects https local self-signed certificate to a trusted certificate access

The installation process slightly.

1, the certificate ready

Local debugging, you can install a self-signed certificate, the installation method reference https local self-signed certificate to a trusted certificate access

2, modify the configuration file

Copy profile to the above conf directory, add or modify a node follows

http{ 
  server {
        listen       443 ssl;
        server_name  www.aaa.com;

        ssl on;
        ssl_certificate      www.aaa.com+5.pem;
        ssl_certificate_key  www.aaa.com+5-key.pem;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        #charset koi8-r;
        access_log logs/aiPlatform/access_log;
        error_log  logs/aiPlatform/error_log   error;
        
        location / {            
            proxy_pass  http://127.0.0.1:8111;
            proxy_redirect   off;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }
}

The above configuration will forward the request to the local http://127.0.0.1:8111 all https://www.aaa.com

At the same time put forward the remote host information, and other information to the proxy ip 8111 corresponding web service

Guess you like

Origin www.cnblogs.com/passedbylove/p/12060728.html