build uri recognizing port