diff --git a/packages/docs/docs/getting-started/production-deployment.md b/packages/docs/docs/getting-started/production-deployment.md index 0a7b3c1..640a66d 100644 --- a/packages/docs/docs/getting-started/production-deployment.md +++ b/packages/docs/docs/getting-started/production-deployment.md @@ -63,7 +63,7 @@ example.com { # ATProto XRPC — rewrite to base path before proxying handle /xrpc/* { - uri prefix /hv + rewrite * /hv{uri} reverse_proxy happyview:3000 } @@ -74,7 +74,7 @@ example.com { } ``` -The `uri prefix /hv` directive prepends `/hv` to the request path before proxying, so `/xrpc/com.atproto.sync.getRecord` becomes `/hv/xrpc/com.atproto.sync.getRecord` — which matches HappyView's nested routes. +The `rewrite * /hv{uri}` directive prepends `/hv` to the request path before proxying, so `/xrpc/com.atproto.sync.getRecord` becomes `/hv/xrpc/com.atproto.sync.getRecord` — which matches HappyView's nested routes. ### Health checks with a base path diff --git a/src/auth/routes.rs b/src/auth/routes.rs index 019d773..cf9a61f 100644 --- a/src/auth/routes.rs +++ b/src/auth/routes.rs @@ -260,8 +260,8 @@ async fn callback( .config .base_path .as_ref() - .map(|bp| format!("{}/", bp)) - .unwrap_or_else(|| "/".into()); + .map(|bp| format!("{}/dashboard/", bp)) + .unwrap_or_else(|| "/dashboard/".into()); let redirect_url = redirect_url.unwrap_or(default_redirect); tracing::debug!(redirect_url = %redirect_url, "redirecting after callback"); diff --git a/src/server.rs b/src/server.rs index 8bc2887..31fc30c 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1,6 +1,6 @@ use axum::extract::{DefaultBodyLimit, State}; use axum::http::{Method, header}; -use axum::response::{IntoResponse, Response}; +use axum::response::{IntoResponse, Redirect, Response}; use axum::routing::{get, post}; use axum::{Json, Router}; use bytes::Bytes; @@ -135,6 +135,7 @@ pub fn router(state: AppState) -> Router { let app_routes = Router::new() .nest("/admin", admin::admin_routes(state.clone())) .merge(domain_routes) + .route("/", get(|| async { Redirect::to("/dashboard/") })) .fallback_service(serve_dir); let outer = if let Some(ref base_path) = state.config.base_path {