Code Monkey home page Code Monkey logo

Comments (3)

yisier avatar yisier commented on September 6, 2024

拿nginx 举例,如果只穿透https端口,访问80时,会报 状态码:497 HTTP Request Sent to HTTPS Port 发送到HTTPS端口请求

可以设置nginx 自动跳转到https,参考下nginx的配置

server {
        listen 443 ssl;
        server_name www.xxx.com;
        error_page  497 https://$http_host$request_uri;  # 重点在这里,只需要一行配置

        ssl_certificate /usr/local/nginx/cert/7172296_www.xxx.com.pem;
        ssl_certificate_key /usr/local/nginx/cert/7172296_www.xxxx.com.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 / {
            root   html;
            index  index.html index.htm;
        }

        error_page 500 502 503 504 /50x.html;
    }

from nps.

xuanpro avatar xuanpro commented on September 6, 2024

并不是nginx,而且是用的域名解析的证书,就比如说nps的管理页面就不能自动跳转

from nps.

gisxlab avatar gisxlab commented on September 6, 2024

请教web管理页https怎么配置呀?

  • 按照教程配置后提示“此站点的连接不安全 ERR_SSL_PROTOCOL_ERROR”:
  • nps.mydomain.com SSL证书已申请并替换

教程:如果web管理需要使用https,可以在配置文件nps.conf中设置web_open_ssl=true,并配置web_cert_file和web_key_file

web_host=nps.mydomain.com
web_username=admin
web_password=123456
web_port = 10088
web_ip=0.0.0.0
web_base_url=
web_open_ssl=true
web_cert_file=conf/server.pem
web_key_file=conf/server.key`

from nps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.