ubuntu16.04, Nginx, HTTPS, Golang

Source: Internet
Author: User

In the following configuration, the final verification is possible. Just no jump

server {        listen 80;        listen 443 ssl;        #ssl on;        server_name hc-explorer.h.cash;        ssl_certificate /etc/nginx/cert/7d97acd273b4a22.crt;        ssl_certificate_key /etc/nginx/cert/key;        ssl_session_timeout 5m;        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;        ssl_prefer_server_ciphers on;        location / {                proxy_set_header Host $http_host;                proxy_set_header X-Real-IP $remote_addr;                proxy_set_header Upgrade $http_upgrade;                proxy_set_header Connection "upgrade";                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                proxy_set_header X-Forwarded-Proto $scheme;                 proxy_redirect off;                proxy_pass http://localhost:7789;        }}

The following jump was successful.

server{Listen 80;        server_name Hc-explorer.h.cash; Rewrite ^ https://$http _host$request_uri? Permanent;}        server {listen 443 SSL;        #ssl on;        server_name Hc-explorer.h.cash;        SSL_CERTIFICATE/ETC/NGINX/CERT/7D97ACD273B4A22.CRT;        Ssl_certificate_key/etc/nginx/cert/key;        #ssl_session_timeout 5m; #ssl_ciphers ecdhe-rsa-aes128-gcm-sha256:ecdhe:ecdh:aes:high:! null:!anull:! md5:! Adh:!        RC4;        #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;        #ssl_prefer_server_ciphers on;                Location/{Proxy_set_header Host $http _host;                Proxy_set_header X-real-ip $remote _addr;                Proxy_set_header Upgrade $http _upgrade;                Proxy_set_header Connection "Upgrade";                Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;                Proxy_set_header X-forwarded-proto $scheme;                Proxy_redirect off;        Proxy_pass http://localhost:7789; }}
Related Article

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.