Avatars are broken after migrating to minio

after I migrating to minio, some uploads and avatars are broken.

Failed to process hijacked response correctly : undefined method `path' for nil:NilClass

/var/www/discourse/app/controllers/user_avatars_controller.rb:158:in `proxy_avatar'
/var/www/discourse/app/controllers/user_avatars_controller.rb:122:in `show_in_site'
/var/www/discourse/app/controllers/user_avatars_controller.rb:78:in `block (2 levels) in show'
/var/www/discourse/lib/hijack.rb:56:in `instance_eval'
/var/www/discourse/lib/hijack.rb:56:in `block in hijack'
/var/www/discourse/lib/scheduler/defer.rb:94:in `block in do_work'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/lib/scheduler/defer.rb:89:in `do_work'
/var/www/discourse/lib/scheduler/defer.rb:79:in `block (2 levels) in start_thread'

And I found this code:

my minio is not deploy on another port, the reason is complex.
comment out this line then it works.

I wonder why discourse is judge that. http/s not on 80/443 is definitely a valid url.

also maybe related to https://meta.discourse.org/t/all-avatar-uploads-are-broken/64466

There are lots of networks who won’t allow users to receive TLS encapsulated traffic on non standard ports. Slapping a port number on the back of an HTTPS address isn’t a solution for other issues introduced upstream.