Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to serve a different index #140

Open
justinhandley opened this issue Nov 18, 2024 · 2 comments
Open

Is there a way to serve a different index #140

justinhandley opened this issue Nov 18, 2024 · 2 comments

Comments

@justinhandley
Copy link

I'm looking for a way to serve a site at / without messing with the functionalities that the server provides, which I think should be easy - but without setting up local dev / hacking the code / potentially making future updates more difficult for myself, I'm wondering if there is an easy way to do this that I'm not thinking about.

@geek-at
Copy link

geek-at commented Nov 21, 2024

It would be nice to have an official way to do it but currently i can only be done via workarounds like the one described here: https://cprimozic.net/notes/posts/notes-on-self-hosting-bluesky-pds-alongside-other-services/

The official way is seemingly to use a whole domain just for bluesky you can't use for anything else. Would be nice to at least have forward handles to their bluesky profiles or config access to caddy to manually configure it

@geek-at
Copy link

geek-at commented Nov 21, 2024

Oh I found another seemingly easier way.

If you set up your server using the official script it creates a caddyfile under /pds/caddy/etc/caddy/Caddyfile

If you edit it to look something like this (replace yourdomain with your domain obviously):

{
        email [email protected]
        on_demand_tls {
                ask http://localhost:3000/tls-check
        }
}

yourdomain {
        tls {
                on_demand
        }

        # Forward API requests to the PDS server
        route /xrpc/* {
                reverse_proxy http://localhost:3000
        }

        # Optionally, forward other PDS-specific paths to the PDS server
        route /.well-known/* {
                reverse_proxy http://localhost:3000
        }

        # Serve your custom site for all other paths
        root * /data/www
        file_server
}

*.yourdomain {
        tls {
                on_demand
        }
        reverse_proxy http://localhost:3000
}

Then you can put HTML files in /pds/caddy/data/www/ and it will be displayed when someone visits your root domain.

Not sure though if the Caddyfile is going to be overwritten by updates so probably a good idea to save the modified version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants