Use HTTP_HOST instead of SERVER_NAME for better portability.