I have created an API using Apche2 mod_wsgi Flask. The API has python & shell script components. The initial version of the API was HTTP, but now I have added HTTPS support as well.
When I am hitting the API via HTTP (http://myapi.mydomain.com/app/apiEndPOint), everything works smoothly. Here pwd command returns /var/www as the present working directory. But when I hit the API via HTTPS (https://myapi.mydomain.com/app/apiEndPOint), it couldn't find different modules (hence it throws errors) because of pwd command returns / as the present working directory. 
Why is this happening? I faced the similar problem with python (os.getcwd()) but solved it using an alternate method. But the pwd command problem I couldn't solve.
Any clues/solutions to this problem?