Nginx Configuration HTTPS Request

Source: Internet
Author: User

1, first go to this site to apply for a certificate

Https://certmall.trustauth.cn/Home/Member/index/id/1521167511.html

It will teach you how to do it.

2, is the configuration of their own nginx.

Remember this must be installed since

Yum Install OpenSSL Openssl-devel

See the following 2 documents.

Http://www.cnblogs.com/chen-msg/p/8582374.html

Http://www.cnblogs.com/chen-msg/p/7754411.html

3, configuration

Nginx.conf

#user nobody;worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections 1024;}    HTTP {include mime.types;    Default_type Application/octet-stream;  #log_format Main ' $remote _addr-$remote _user [$time _local] "$request" ' # ' $status $body _bytes_sent    "$http _referer" ' # ' "$http _user_agent" "$http _x_forwarded_for";    #access_log Logs/access.log Main;    Sendfile on;    #tcp_nopush on;    #keepalive_timeout 0;    Keepalive_timeout 65;    #gzip on;        server {Listen 80;        server_name localhost;        #charset Koi8-r;        #access_log Logs/host.access.log Main;            Location/{root/opt/my/html/pc/html/html;        Index index.html;        } location/sendtkl/{Proxy_pass http://127.0.0.1:8688/water-tk-main/tklConvert/; } location/mytk/{Proxy_pass http://127.0.0.1:8688/water-tk-main/;        Proxy_set_header Host $host: $server _port;        } #error_page 404/404.html;        # REDIRECT Server error pages to the static page/50x.html # Error_page 502 503 504/50x.html;        Location =/50x.html {root html; } # Proxy The PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ {# ProX        Y_pass http://127.0.0.1;        #} # Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ {        # root HTML;        # Fastcgi_pass 127.0.0.1:9000;        # Fastcgi_index index.php;        # Fastcgi_param Script_filename/scripts$fastcgi_script_name;        # include Fastcgi_params; #} # Deny access to. htaccess files, if Apache ' s document Root # concurs with Nginx ' s one # #location ~/\.ht {# deny all;       #}} # Another virtual host using mix of ip-, name-, and port-based configuration # #server {# listen    8000;    # Listen somename:8080;    # server_name somename alias Another.alias;    # location/{# root HTML;    # index index.html index.htm;        #} #} # HTTPS Server # server {listen 443 SSL;  server_name www.ttgwzs.com;        #网站域名, and 80 ports to maintain consistent SSL on;       SSL_CERTIFICATE/USR/LOCAL/NGINX--WITH-HTTP_STUB_STATUS_MODULE/CONF/WWW.TTGWZS.COM_BUNDLE.CRT;  #证书公钥 Ssl_certificate_key/usr/local/nginx--with-http_stub_status_module/conf/www.ttgwzs.com.key;        #证书私钥 Ssl_session_cache shared:ssl:1m;        Ssl_session_timeout 5m;         Ssl_protocols TLSv1 TLSv1.1 TLSv1.2; Ssl_ciphers ecdh:aesgcm:high:! rc4:! Dh:!        Md5:!3des:!anull:!enull;        Ssl_prefer_server_ciphers on;            Location/{Proxy_pass http://www.ttgwzs.com;                 Proxy_redirect off;                 Proxy_set_header Host $http _host;                 Proxy_set_header X-real-ip $remote _addr;                 Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;            Proxy_set_header Cookie $http _cookie;                   #proxy_cookie_path chunked_transfer_encoding off; }    }}

Nginx Configuration HTTPS Request

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.