nginx https

生成证书:

openssl genrsa -des3 -out wurd.key 1024 -days 36500
openssl req -new -key wurd.key -out wurd.csr -days 36500

cp wurd.key wurd.key.org

去密码
openssl rsa -in wurd.key.org -out wurd.key
openssl x509 -req -days 36500 -in wurd.csr -signkey wurd.key -out wurd.crt

 

nginx配置:

client_max_body_size     50000m;
    client_header_timeout    10000m;
    client_body_timeout      10000m;
    proxy_connect_timeout     10000m;
    proxy_read_timeout      10000m;
    proxy_send_timeout      10000m;

server {
        listen       443 ssl;
        server_name  localhost;
        
        if ($request_method !~ ^(GET|PUT|POST|DELETE)$ ) {
            return 403;
        }
        
        #proxy_intercept_errors on;
        #error_page  404  /40x.html;
        #location = /40x.html {
        #    root   html;
        #}
        #error_page  500  /50x.html;
        #location = /50x.html {
        #    root   html;
        #}

        ssl_certificate      D://wurd.crt;  #
        
        ssl_certificate_key  D://wurd.key;  #

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
          proxy_pass http://localhost:80;
          proxy_cookie_path / "/; httponly; secure";
          
        }
        
    }

 

限制访问次数:

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

server {

    location /auth/login {

        limit_req zone=one burst=5 nodelay;

    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值