Http-bind - forwarding

Hi. I need help. Could you give me a hint how to solve my problem?
I have two VPS servers: VPS-1 (1.1.1.1) and VPS-2 (2.2.2.2).
I have openfire installed on VPS-1. It also works with http Bind - https://1.1.1.1:7443/http-bind/.
The second server is only for traffic redirection. I have it set on it, if something comes to port 5222, it is to redirect it to the address 1.1.1.1:5222. And it works.
Users, for example, in conversation set:
user@abc.abc
Password
2.2.2.2 port 5222.
And here I see traffic on port 5222 that it goes to the address 2.2.2.2.
However, when transferring files, I see traffic that goes directly from the user to VPS-1, i.e. to the address 1.1.1.1.
Is it possible to set everything to go through VPS-2? So that all traffic appears to be directed to VPS-2 and not directly to openfire (VPS-1).
Thank you for all the tips.

This depends on the mechanism that is used for transfering files (there are a couple of different ones).

If you use the HTTP File Transfer plugin, then you can reconfigure the ‘announced’ web endpoint. It will, by default, use the address of the server that is running Openfire, but you can override this, as documented in the readme file.

The proxy service that is offered by Openfire (which can be used for similar purposes) can be configured in the admin console Server > Server Settings > File Transfer Settings to “Override reported address”, which basically does the same.

There are other bits of functionality that can be reconfigured in a similar way, but sadly, there is no uniform configuration that is used by all of those. That improvement has been registered in our issue tracker as [OF-2117] - Ignite Realtime Jira