Unable to Install Confluence App on Internal Server (Works with Ngrok)

I am developing a Confluence Cloud app and facing an issue where the app installs successfully when using an Ngrok URL (local development). However, when I try to install it using our internal server URL, the installation fails with the following error message:

“The app failed to install. Please try again later or contact the app vendor.”

There are no additional logs or errors displayed on the Confluence UI and also in server side during installation.

Details of the Setup:
Atlassian Product: Confluence Cloud
App Key: confluence-app
Installation Works With: Ngrok URL (e.g., https://random.ngrok.io)
Installation Fails With: Internal server URL (https://qa1.****.com/confisecure-confluence)
Authentication Method: JWT
Scopes: READ, WRITE, ACT_AS_USER
Database: PostgreSQL
Hosting Environment: Internal Server

Here is the atlassian-connect.json

{
“key”: “confluence-app”,
“name”: “ConfiSecure”,
“description”: “Security for Confluence”,
“baseUrl”: “{{localBaseUrl}}”,
“authentication”: {
“type”: “jwt”
},
“lifecycle”: {
“installed”: “/installed”
},
“enableLicensing”: true,
“scopes”: [
“READ”,
“WRITE”,
“ACT_AS_USER”
],
“apiMigrations”:{
“signed-install”: true
},
“modules”: {
“generalPages”: [
{
“key”: “hello-world-page-jira”,
“location”: “system.top.navigation.bar”,
“name”: {
“value”: “Hello World”
},
“url”: “/hello-world”,
“conditions”: [{
“condition”: “user_is_logged_in”
}]
},
{
“key”: “hello-world-page-confluence”,
“location”: “system.header/left”,
“name”: {
“value”: “Hello World”
},
“url”: “/hello-world”,
“conditions”: [{
“condition”: “user_is_logged_in”
}]
}
]
}
}

Could you help identify potential reasons why the installation works via Ngrok but fails when using an internal server URL?

Best regards,
Naveen