diff --git a/conf/nginx.conf b/conf/nginx.conf index 12f8470..734c163 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -33,7 +33,7 @@ http { add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "no-referrer" always; - location ~ ^/(verification|fileupload|filedownload)/ { + location ~ ^/(health|verification|fileupload|filedownload)/ { proxy_pass http://backend:8000; } } diff --git a/conf/nginx.dev.conf b/conf/nginx.dev.conf index e545419..ece04d1 100644 --- a/conf/nginx.dev.conf +++ b/conf/nginx.dev.conf @@ -29,7 +29,7 @@ http { add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "no-referrer" always; - location ~ ^/(verification|fileupload|filedownload)/ { + location ~ ^/(health|verification|fileupload|filedownload)/ { proxy_pass http://backend:8000; } diff --git a/cryptify-back-end/src/main.rs b/cryptify-back-end/src/main.rs index 44802e0..ce2e0d0 100644 --- a/cryptify-back-end/src/main.rs +++ b/cryptify-back-end/src/main.rs @@ -69,6 +69,10 @@ struct InitResponder { cryptify_token: CryptifyToken, } +#[get("/health")] +fn health() -> &'static str { + "OK" +} #[post("/fileupload/init", data = "")] async fn upload_init( config: &State, @@ -431,7 +435,7 @@ async fn rocket() -> _ { rocket .attach(cors) - .mount("/", routes![upload_init, upload_chunk, upload_finalize,]) + .mount("/", routes![health,upload_init, upload_chunk, upload_finalize,]) .mount("/filedownload", FileServer::from(config.data_dir())) .attach(AdHoc::config::()) .manage(Store::new())