Original PR #32 from @nicokant
Nginx configuration uses $host variable that doesn't provide custom ports, causing errors with request.build_absolute_url. This PR aims to fix providing also non-standard port specified as HTTP_PORT/HTTPS_PORT.
Related issues: