Small applications can be created in Invantive App Online and made publicly available through a proxy. This historical topic describes such steps for the combination of AWS CloudFront, AWS S3 and Invantive App Online.
With the increased use of non-US owned datacenters, Caddy can be an alternative for AWS CloudFront. Caddy is largely functionally equivalent to AWS CloudFront with Lambda @Edge, and can be run on a large number of platforms.
However, Caddy by itself lacks the massive number of edge nodes AWS CloudFront provides across the globe. Additional steps are necessary in case performance must be excellent across all continents.
The following Caddy configuration is an example on how to use Caddy instead of AWS CloudFront with an Invantive App Online application. It serves static content from Scaleway buckets instead of AWS S3.
The dynamic content is generated by Invantive App Online.
#
# Snippet.
# Rewrite acme.com/something to www.acme.com/something
# when imported.
#
(redirectwww) {
redir https://www.{host}{uri} permanent
}
##########################################################################
#
# acme.eu
#
##########################################################################
www.acme.eu
{
import redirectroot
handle /svg/* {
reverse_proxy http://acme.eu.s3.fr-par.scw.cloud {
header_up Host acme.eu.s3.fr-par.scw.cloud
header_down Cache-Control "public,max-age=86400,stale-while-revalidate=172800"
}
}
handle /js/* {
reverse_proxy http://acme.eu.s3.fr-par.scw.cloud {
header_up Host acme.eu.s3.fr-par.scw.cloud
header_down Cache-Control "public,max-age=86400,stale-while-revalidate=172800"
}
}
handle {
@orig path_regexp origPath ^/(.*)$
rewrite @orig /apps/86244979-c81d-42c9-a65b-6ca002b83a3c/databases/xxwg-user/modules/b3c833ee-a2d6-40a4-a202-17de2283a4ed/{http.regexp.origPath.1}
reverse_proxy https://app-online.invantive.com {
header_up Host app-online.invantive.com
header_up Authorization "Basic base64-of-user-and-password"
header_up .AspNetCore.Session {>.AspNetCore.Session}
header_up Cookie {>Cookie}
header_up Referer {>Referer}
header_up User-Agent {>User-Agent}
header_up Accept-Language {>Accept-Language}
header_down Cache-Control "public,max-age=86400,stale-while-revalidate=172800"
header_down -Location
}
}
encode gzip zstd {
minimum_length 1024
}
}
acme.eu
{
import redirectwww
}