Static documentation auth question

Hi, I want to start writing documentation with something like docusaurus or docsify but I don't want it to publicly accessible. Ideally it would be accessible if you are logged in with filament and redirect to login page if you are accessing docs logged-out and redirect back to docs when logged in. I considered multiple options but they all feel wrong. booting up laravel for every static file request kinda defeats the point of a static site generator. serving behind an nginx internal location that hits a laravel route with the session cookie, feels overengineered. serve the static files from a private s3 url generated by laravel, not sure if thats possible what would you do?
4 Replies
Dennis Koch
Dennis Koch4w ago
If you have easy access to the nginx file, that's probably the cleanest one. Depending on how secure your docs need to be. You can also just host them on a cryptic URL. That doesn't protect against sharing the URL though
MauFunction
MauFunctionOP4w ago
Interesting, but nginx would hit laravel for every request
Dennis Koch
Dennis Koch4w ago
There's no way around it, if you want to authenticate through PHP Probably Still better than serve the files through PHP
MauFunction
MauFunctionOP4w ago
Yeah, maybe i can cache the auth_request response

Did you find this page helpful?