用户工具

站点工具


prog:linuxnet:caddy

Caddy

caddyfile

{
    email inkitter@gmail.com
}


10.10.10.50 {
    respond "Hello, world!443"
}

p.inkit.cc:10080 {
    @websockets {
        header Connection *Upgrade*
        header Upgrade    websocket
    }
    reverse_proxy @websockets /a/* https://inkit.cc
    reverse_proxy /b/* 10.10.10.50:18006
    file_server
    tls /etc/letsencrypt/live/inkit.cc/cert.pem /etc/letsencrypt/live/inkit.cc/privkey.pem
    #respond "Hello, world!443"
}

pvewrt.inkit.cc:10080 {
    root * /var/www/html/
    encode gzip
    file_server
    php_fastcgi 127.0.0.1:9000
    {
        index index.php
    }
    tls /etc/letsencrypt/live/inkit.cc/cert.pem /etc/letsencrypt/live/inkit.cc/privkey.pem
    #respond "Hello, world!443"
}
wi.inkit.cc:10080 {
    root * /var/www/wiki/
    encode gzip
    file_server
    php_fastcgi 127.0.0.1:9000
    {
        index doku.php
    }

    # internal /forbidden

    tls /etc/letsencrypt/live/inkit.cc/cert.pem /etc/letsencrypt/live/inkit.cc/privkey.pem

    @forbidden path_regexp forbidden /(data/|conf/|bin/|inc/|install.php)
    rewrite @forbidden /lib/exe/fetch.php?media={re.media.1}&{query}
    
    @media path_regexp media ^/_media/(.*)
    rewrite @media /lib/exe/fetch.php?media={re.media.1}&{query}

    @detail path_regexp detail ^/_detail/(.*)
    rewrite @detail /lib/exe/detail.php?media={re.detail.1}&{query}

    @export path_regexp export ^/_export/([^/]+)/(.*)
    rewrite @export /doku.php?do=export_{re.export.1}&{query}&id={re.export.2}

    @doku {
        not path_regexp lib /lib/.*
        path_regexp doku /(.*)
    }
    rewrite @doku /doku.php?id={re.doku.1}&{query}

    # # @do path_regexp do ^$
    # # rewrite @doku /doku.php

    # # @dod path_regexp dod ^index.php$
    # # rewrite @doku /doku.php
}

dokuwiki rewrite

    @forbidden path_regexp forbidden /(data/|conf/|bin/|inc/|install.php)
    rewrite @forbidden /lib/exe/fetch.php?media={re.media.1}&{query}
    
    @media path_regexp media ^/_media/(.*)
    rewrite @media /lib/exe/fetch.php?media={re.media.1}&{query}

    @detail path_regexp detail ^/_detail/(.*)
    rewrite @detail /lib/exe/detail.php?media={re.detail.1}&{query}

    @export path_regexp export ^/_export/([^/]+)/(.*)
    rewrite @export /doku.php?do=export_{re.export.1}&{query}&id={re.export.2}

    @doku {
        not path_regexp lib /lib/.*
        path_regexp doku /(.*)
    }
    rewrite @doku /doku.php?id={re.doku.1}&{query}
prog/linuxnet/caddy.txt · 最后更改: 2020/10/21 23:41 (外部编辑)