Fixed purge url formation to work correctly in https mode