Radek
January 9, 2024, 2:50pm
1
hi
I would like to use fly to run a simple static web site - blog like where some categories would be protected by password - on fly. Using adoc or anything similar. Web site content stored in github displayed by fly. Is that possible?
Thank you
Radek
1 Like
billy
January 9, 2024, 3:51pm
2
Hi,
You could do something like using the jekyll Docker image to build the static web page, and then expose the site using the http_service section in your fly.toml
1 Like
Radek
January 9, 2024, 4:33pm
3
it doesn’t look like there is simple way to protect separate pages by password in jekyll
billy
January 9, 2024, 4:39pm
4
It looks like there are jekyll plugins you can use for authentication, such as jekyll-auth . Would that work for what you need?
Radek
January 9, 2024, 4:57pm
5
not really. I already checked that. I do not want to force users to have a Google account…
let’s say I have site web.com
web.com/welcome - anyone can access
web.com/page1 - only those with secret password “password1” can a access such page
web.com/page2 - only those with secret password “password123” can a access such page
Tc001
January 9, 2024, 5:19pm
6
You can use Caddy!
A config would look something like:
http://localhost:8080 {
root * /path/to/your/site
file_server
basicauth /page1/* {
User <password hash>
}
basicauth /page2/* {
User <password hash>
}
}
(note: localhost 8080 is used if you want fly to handle the certificates, it is also possible to have Caddy handle them but that is a bit more setup)
Further reading:
https://hub.docker.com/_/caddy#:~:text=Building%20your%20own%20Caddy-based%20image
3 Likes
system
Closed
April 27, 2024, 12:34am
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.