How to add port number in "Confirm your email address" link?

Dear GitLab and any developers.

I installed Gitlab CE 12.4.2 to ubuntu 16.04 LTS base.
Then I setup my office SMTp email for sending notification email to user.
SMTP email sending is working normally.

When add new user by admin, GitLab send “Confirmation instructions” email to user.
I have a problem, “Confirm your email address” URL link does not included port number.

For example, my GitLab site URL is “http://10.20.30.40:12345”.
For connecting my GitLab site, URL need to added IP(10.20.30.40) with PORT_NUMBER(:12345).

< Issue point >
But, now “Confirm your email address” URL link in “Confirmation instructions” email does not contain the port number.
URL link set “http://10.20.30.40/profile/…”, so when user click a link, web browser is shown “404 not found” error page.

< Problem >
Due to not including port nubmer in “Confirm your email address” link, when occur “404 not found”,
user should add URL http://10.20.30.40/profile/… to http://10.20.30.40:12345/profile/… by himself.

< Need to find solution >
I would like to add port number to “Confirm your email address” link as “http://10.20.30.40:12345/profile/…”.
Where should I modify gitlab.rb?

Please, help and resolve my issue.

Thank you.