diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb
index bd5dddcac6f130d4750a1bcad44235097cca11c9..3d7f08cd38224d817fd6d61941774376e410c715 100644
--- a/app/lib/activitypub/tag_manager.rb
+++ b/app/lib/activitypub/tag_manager.rb
@@ -70,7 +70,10 @@ class ActivityPub::TagManager
   end
 
   def local_uri?(uri)
-    host = Addressable::URI.parse(uri).normalized_host
+    uri  = Addressable::URI.parse(uri)
+    host = uri.normalized_host
+    host = "#{host}:#{uri.port}" if uri.port
+
     !host.nil? && (::TagManager.instance.local_domain?(host) || ::TagManager.instance.web_domain?(host))
   end