Since our osticket runs internally only, we never used https with osTicket, but my suggestion would be to check / make sure that the helpdesk URL is also set to HTTPS://whatever-your-osTicket-URL-is/ under admin panel > settings > system.
Regarding the rewrite condition I'm not sure if that's the right approach to check for port 80, surely works, but in my opinion there are better checks - any search engine like Google, Bing, etc. is your friend here ;)