zoukankan      html  css  js  c++  java
  • caddy server 了解

    Caddy 是一个Go写的服务器软件,官方的宣传语“The HTTP/2 web server with automatic HTTPS”以及“Serve The Web Like It's 2016”简明表达了这个软件的优点和趋势,它拥有基本的apache或者nginx有的web server模块,同时还有一些很有特色的功能,比如:

    • HTTP/2
    • Automatic HTTPS
    • Multi-core
    • Websockets
    • Markdown
    • IPv6
    • Git
    • …...

    用Caddy我们就可以很方便的部署一个Markdown文本作为静态网站访问,或者它的Git指令完成代码的自动化部署,当然它很大的特色就是它的语法非常简洁,比nginx还要简单,配置部署起来很方便,下面随便举几个例子吧。

    • 对网站添加 BasicAuth ,用户名ryan,密码 12345
    basicauth / ryan 12345  
    
    • 用 CORS 解决跨域问题
    cors / {  
        origin            http://allowedSite.com
        origin            http://anotherSite.org https://anotherSite.org
        methods           POST,PUT
        allow_credentials false
        max_age           3600
        allowed_headers   X-Custom-Header,X-Foobar
        exposed_headers   X-Something-Special,SomethingElse
    }
    
    • IP过滤
    ipfilter / {  
        rule       block
        ip         212.10.15.0-255 213.10.15.0-10 5.23.4.24
        blockpage  /local/data/default.html
    }
    
    • HTTPS 配置
    tls ../cert.pem ../key.pem  
     
  • 相关阅读:
    uva299 Train Swapping
    uva 10106 Product
    uva 340 MasterMind Hints
    uva 10115 Automatic Editing
    uva748 Exponentiation
    uva152 Tree's a Crowd
    uva 10420 List of Conquests
    uva 644 Immediate Decodability
    要知其所以然的学习(转载)
    持有书籍统计
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/6580851.html
Copyright © 2011-2022 走看看