Giter Club home page Giter Club logo

lets-chaproxy's Introduction

Lets CHaproxy

Introduction

This repository it's the cpp version of the Let's Haproxy project. The hpp files it's in stb style.

This package solves the problem of using Lets Encrypt certificates into Haproxy, getting, renewing and configuring them automagically for you.

Just a Docker container where you mount your Haproxy configuration file. Simply works.

Bugs

If you find a bug on this package, open an issue explaining the problem, make a fork, fix it and make a pull request to merge your changes to this repository

How to use

docker run -it \
  --env [email protected] \
  --env ENVIRONMENT=staging \
  -v "./haproxy.cfg:/usr/src/app/templates/haproxy.user.cfg" \
  -v "letsencrypt_logs:/var/log/letsencrypt" \
  -v "letsencrypt_data:/etc/letsencrypt" \
  develolux/lets-chaproxy:latest

haproxy.cfg file

As you can see, we bind the haproxy.cfg file to the container. This is your normal configuration file, nothing new. The only thing you need to define for sure is a frontend binded to 443 port with the domains you want to cert. For example:

# CONFIGS APPLIED GLOBALLY
global
    maxconn 32768
    daemon

# CONFIGS APPLIED BY DEFAULT ON FRONTENDS AND BACKENDS
defaults
    mode    http
    retries 3
    timeout connect     5s
    timeout client     50s
    timeout server    450s

# FRONTENDS HTTP
frontend http-in
    bind *:80

    acl http ssl_fc,not
    http-request redirect scheme https if http

# FRONTENDS HTTP
frontend https-in
    bind *:443
    mode http

    acl host_domain hdr(host) -i domain.com
    use_backend cluster_domain if host_domain

    acl host_subdomain_domain hdr(host) -i subdomain.domain.com
    use_backend cluster_subdomain_domain if host_subdomain_domain

# BACKENDS HTTP
backend cluster_domain
    mode http
    balance roundrobin
    option forwardfor
    server node1 192.168.0.4:8020 check

backend cluster_subdomain_domain
    mode http
    balance roundrobin
    option forwardfor
    server node1 192.168.0.4:8010 check

# FRONTENDS TCP
frontend minecraft-in
    bind *:25565
    mode tcp
    use_backend cluster_minecraft

# BACKENDS TCP
backend cluster_minecraft
    mode tcp
    server node1 192.168.0.4:25565 check

There is a frontend binded to the port 443 with the domains defined as you usually would do it. They will be automatically detected and certs will be craft for them. Dont worry about anything and enjoy it.

lets-chaproxy's People

Contributors

sebastocorp avatar

Stargazers

Alby Hernández avatar

Watchers

 avatar

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.