Skip to content

Instantly share code, notes, and snippets.

@tcoupin
Last active May 29, 2020 07:26
Show Gist options
  • Save tcoupin/31bb38d1c02c501810e5 to your computer and use it in GitHub Desktop.
Save tcoupin/31bb38d1c02c501810e5 to your computer and use it in GitHub Desktop.

Revisions

  1. tcoupin revised this gist Feb 15, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions haproxy.cfg
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ frontend http-in-ext
    reqrep (.*)/seamedia/(.*) \1/seahub/seamedia/\2
    acl path_seahub path_beg /seahub
    acl path_seafile path_beg /seafhttp

    #Force https
    redirect scheme https if path_seahub !{ ssl_fc }
    redirect scheme https if path_seafile !{ ssl_fc }

  2. tcoupin created this gist Feb 15, 2016.
    20 changes: 20 additions & 0 deletions haproxy.cfg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    frontend http-in-ext
    bind 0.0.0.0:80
    bind 0.0.0.0:443 ssl crt /SSL/yourcert.pem
    option forwardfor

    reqrep (.*)/seamedia/(.*) \1/seahub/seamedia/\2
    acl path_seahub path_beg /seahub
    acl path_seafile path_beg /seafhttp
    redirect scheme https if path_seahub !{ ssl_fc }
    redirect scheme https if path_seafile !{ ssl_fc }

    use_backend seahub if path_seahub
    use_backend seafile if path_seafile

    backend seahub
    server pi1 pi1:8000 check

    backend seafile
    reqrep (.*)/seafhttp/(.*) \1/\2
    server pi1 pi1:8082 check