The installation of the relevant software is not stated here.
To generate a certificate:
sudo OpenSSL req-x509-nodes-days 365-newkey rsa:2048-keyout/etc/nginx/cert.key-out/etc/nginx/cert.crt
edit nginx Domain name configuration file:
Server{listen 443;server_name python.org *.python.org;ssl_certificate /etc/nginx/cert.crt;ssl_certificate_key /etc/nginx/cert.key;ssl on;ssl_session_cache builtin:1000 shared:ssl:10m;ssl_protocols TLSv1 TLSv1.1 tlsv1.2;ssl_ciphers high:!anull:!enull:! export:! camellia:! Des:! md5:! Psk:! Rc4;ssl_prefer_server_ciphers On;access_log /var/log/nginx/python.log;location/{proxy_redirect Off;proxy_set _header Host $host;p roxy_set_header x-real-ip $remote _addr;proxy_set_header x-forwarded-for $proxy _add_x_forwarded_ for;# proxy_pass $request;p roxy_pass https://$host $uri;}
The following instructions are not available on the Nginx manual
Proxy_pass $request;
Then modify the nginx.conf.
Add the domain name resolution under the HTTP node:
Resolver 8.8.8.8;
Modify the Hosts file to test
wget --no-check-certificate-d ' https://www.python.org '
Test OK. Complete the installation successfully.
However, it cannot be accessed on the browser because our certificate is not issued by an authoritative authority.
After all this, the www.python.org can be visited again.
Nginx Reverse Proxy HTTPS