Nginx Reverse Proxy HTTPS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.