{                     
    admin 0.0.0.0:2019
    email chris@sigd.net
}

# Internal Services
gitea.sigd.net {
    reverse_proxy 10.4.0.156:3000
} 

statistics.deafgain.org {
    reverse_proxy matomo:80
}

archives.sigd.net {
    reverse_proxy 10.4.0.159:8001
}

upload.sigd.net {
    reverse_proxy 10.4.0.159:4174
}

preview.sigd.net {
    reverse_proxy 10.4.0.83:3000
}

droppy.sigd.net {
    reverse_proxy 10.4.0.159:6969
}

upload.sigd.net/api/* {
    # Forward API requests to the backend API service
    uri strip_prefix /api
    reverse_proxy 10.4.0.159:3334
}

requests.sigd.net {
    reverse_proxy 10.4.0.157:5055
}

documents.deafgain.org {
    reverse_proxy 10.4.0.156:8001
}

documents.sigd.net {
    reverse_proxy 10.4.0.159:8001
}

doculens.deafgain.org {
    reverse_proxy 10.4.0.156:5015
}

firewall.sigd.net {
    reverse_proxy 10.4.0.1:9080
}

# Public Websites (on this VM - 10.4.0.205)

# Deaf Summit Website
deafsummit.org {
    # Route API requests to backend
    handle /api/* {
        reverse_proxy localhost:808
    }

    # Route everything else to frontend
    handle {
        reverse_proxy localhost:807
    }
}

www.deafsummit.org {
    redir https://deafsummit.org{uri} permanent
}

# DeafMissoula.org
www.deafmissoula.org {
    redir https://deafmissoula.org{uri} permanent
}

deafmissoula.org {
    reverse_proxy 172.18.0.7:801
}

# ChrisHaulmark.com
www.chrishaulmark.com {
    redir https://chrishaulmark.com{uri} permanent
}

chrishaulmark.com {
    reverse_proxy chrishaulmark-website-web-1:803
}

# DeafGain.org
www.deafgain.org {
    redir https://deafgain.org{uri} permanent
}

deafgain.org {
    reverse_proxy 172.18.0.4:804
}

# FinLion domains
finlion.com {
    reverse_proxy finlion-website-web-1:805
}

www.finlion.com {
    redir https://finlion.com{uri} permanent
}

finlion.net, www.finlion.net {
    redir https://finlion.com{uri} permanent
}

finlion.org, www.finlion.org {
    redir https://finlion.com{uri} permanent
}

# MAD Lawsuit
www.mad-lawsuit.org {
    redir https://mad-lawsuit.org{uri} permanent
}

mad-lawsuit.org {
    reverse_proxy mad-lawsuit-frontend-1:806
}
