When I deploy the program on the server, a 502 error occurs when accessing, but the port monitored by the service is running. The following is my main program configuration, I can access it normally when debugging and running on local machine.
use actix_web::{get, web, App, HttpServer, Responder};
use api::user_api;
#[tokio::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.route("/hello", web::get().to(|| async { "api server run successed" }))
.service(user_api::register)
})
.bind(("localhost", 8082))?
.run()
.await
}