Add SSL support for production_url middleware