Nginx forwarding requests, from HTTPS to HTTP

Source: Internet
Author: User
The domain name of the new project is HTTPS, need to access the company's image server, image Server domain name is HTTP, so do a nginx forwarding

server {
Listen 443;
SERVER_NAME new project domain name;
#include ssl.conf;
SSL on;
Ssl_certificate keys/1_ new Project certificate _BUNDLE.CRT;
Ssl_certificate_key keys/2_ New Project certificate. Key;
Include qssl.conf;
Location/{
Include proxy.conf;
Proxy_pass http://New Project Program pool name (upstream.conf);
}
Location ~ /img/Picture Server domain name (com|net)/{
Set $host _name image server domain name;
rewrite/img/(.
). com/(.) $/$2 break;
rewrite/img/(.
). net/(. *) $/$2 break;
Proxy_set_header Host $host _name;
Proxy_pass http://image server IP;

                    -t检查nginx,然后-s  reload                    新项目即能访问图片

Nginx forwarding requests, from HTTPS to HTTP

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.