Masked Redirect and Refused to display 'http://MY_IP_ADD/index.php/login' in a frame because it set 'X-Frame-Options' to 'Sameorigin'

I have a fresh install of nextcloud running on my raspberry pi at home, I just purchased a domain name and I’m trying to get it all set up. From my domain name control panel if I select ā€œURL redirect recordā€ with the correct settings and the option of ā€œunmaskedā€ everything works as expected, but I don’t want my IP address displaying in the address bar, so I leave everything the same except change the ā€œunmaskedā€ option to ā€œmaskedā€ and I get the error in chrome ā€œRefused to display ā€˜http://MY_IP_ADD/index.php/login’ in a frame because it set ā€˜X-Frame-Options’ to ā€˜Sameoriginā€™ā€

I have already added the domain Cname and IP in the trusted domains, I’m really at a loss here as I don’t know how to SAFELY correct for this, I understand this is a security feature so I don’t want to disable it, but I would like to know how to allow for a masked redirect from my domain name? If I’ve left out any important info please feel free to ask, I will list some of my setup specs below. Thank you for taking the time to read this

Nextcloud Version: 10.0 (stable)

PHP Version: 5.6.24

Database Type: Mysql

Apache2

Why don’t you set the DNS entry to your IP directly (if it is a dynamic ip, your provider perhaps has a dynamic dns service included, if not, you can use a dynamic dns solution and then put this dynamic dns name as a CNAME record in your real domain). This iframe-solution shouldn’t be used (it has been disabled for security reasons).

Thank you for your suggestion! My provider does have a dynamic DNS option, however the client it’s having me download is a EXE file, but my server is running on a raspberry pi. What client would you recommend for the rpi 2 model B?

@tflidd, thank you for your suggestion, I managed to get it to work!! Although now I have new problems…

I’m trying to redirect all traffic to https and parts of it are working and other parts, not so much… If I navigate to www.MyDomain.com it goes straight to that address, however, if I navigate to MyDomain.com it redirects correctly to https? I’m sure it’s just something small I’m missing from a config file but I don’t know which one is working when it redirects correctly and which one isn’t working when it doesn’t…

Any help or suggestions would be greatly appreciated!

Thank you in advance!

You probably have to set the variable
ServerAlias www.MyDomain.com
in your http (<VirtualHost *:80>) vhost.