OpenMRS redirecting to/from http and https


I deployed endTB bahmni 1.5.1 release on CentOS server. It is configured to run on port 4433 on public IP (since 443 was not available to use). I am facing an issue when accessing openmrs using port 4433 (but not Bahmni UI). The url https://:4433/openmrs gets redirected to http://:4433/openmrs and browser gives ERR_INVALID_HTTP_RESPONSE.

Do I need to setup apache to redirect to 4433 and not 443?

Try setting apache configuration /etc/httpd/conf.d/ssl.conf

try changing “listen 443” to 4433.

Btw, is this a physical server or a vagrant box?

It is deployed on a physical server. I changed 443 to 4433 in ssl.conf but it didn’t work. Is it necessary for bahmni that 443 be available and we cannot configure it to run on any other port than 443? If we can, then can someone please guide how we can do that?

You shouldn’t have to change openmrs port at all. OpenMRS server runs behind the apache which does a simple proxy pass! Check …

ps -ef | grep openmrs

that should tell you the process of openmrs

sudo netstat -nlp | grep [process id from above]

The above should tell you what port openmrs is listening on. By default this should be 8050.

However, you don’t have to access by that port on the browser.


Doing this from the server machine command prompt should get some some text, and it should validate that openmrs is running and listening properly on desired port.

Apache httpd server acts as proxy for any internal service. So all proxy passes are done through apache. This is specified here

cat /etc/httpd/conf.d/emr_ssl.conf

if you notice its a simple proxy pass. so whatever the listening port of apache, any access to “/openmrs/*” resource will be redirected to openmrs service.

Once you have made the listening port of apache (ssl.conf), restart apache

service httpd restart

Then try to access from a network machine