How to forward all traffic to some external server to server in my LAN

I am not too familiar with iptables and I want to implement following:

Forward traffic from my LAN to server X.X.X.X (somewhere out of my LAN) to my own server Y.Y.Y.Y in my LAN?

Is it possible?

Thanks for advice.

Yes, it‘s called dnat (destination nat). Just google it to learn about it, it can be configuerd through Luci Webinterface.

Or you can do it via UCI (rather than LUCI):

uci add firewall  redirect
uci set firewall.@redirect[-1].name=Allow-HTTPS-Inbound
uci set firewall.@redirect[-1].target=DNAT
uci set firewall.@redirect[-1].src=wan
uci set firewall.@redirect[-1].dest=lan
uci set firewall.@redirect[-1].proto=tcp
uci set firewall.@redirect[-1].src_dport=443
uci set firewall.@redirect[-1].dest_ip=
uci set firewall.@redirect[-1].dest_port=443

uci commit
/etc/init.d/firewall reload