Dynmap-Forge/Fabric

Dynmap-Forge/Fabric

888k Downloads

Dynmap on my subdomain (domain)

LosBagros opened this issue ยท 7 comments

commented

Please help me,
i bought domain and i want on it something like this map.mydomain.com
i have dynmap on port 25775, and i can not change the port because this is free port on my minecraft hosting.
i am using cloudflare.
How to set up dns?

commented

Iframe aren't but you aren't using iframes correctly if you are trying to serve http content vian an iframe to a https website

There are few reasons dynmap should be in an iframe and I wouldn't recommend them to someone trying to mask the port ever. Set up a reverse proxy or external platform controller like the wiki recommends. Then you can bind directly to 80/443 and have a much more robust config

This issue isn't about serving HTTP content on an HTTPS website via iframes and OP has not mentioned using HTTPS. OP in particular mentions that they are using a free port from a Minecraft hosting provider, implying that they do not have access to either 80, or 443, or an external web server altogether. As far as I know, the application does not communicate any sensitive or private information whatsoever, making the use of TLS altogether completely optional, at least in my view. I can only imagine that a great proportion of this plugin's users host their servers on free/shared services (most likely private servers) and for something as simple as this I see it unnecessary to teach all of these people how to work with Unix, HTTP, web servers, reverse proxies, ports, firewalls, etc.

A public/professional server on the other hand shall undoubtedly set up a reverse proxy which should not be too much trouble for your system administrator or anyone with fundamental Unix, httpd, ufw/iptables experience even.

commented

I will use nginx reverse proxy.
Thanks everyone ๐Ÿ‘Œ

commented

This really doesn't qualify as a Dynmap issue, tbh. You should check out the server admin forums at Spigotmc.org or www.minecraftforum.net for this sort of help.

All you need for DNS is an A record for map that points to the IP of your dynmap instance. You will still need to tell people to use map.mydomain.com:25775, unless you can setup a a reverse proxy.

How to manage DNS records at cloudflare
https://support.cloudflare.com/hc/en-us/articles/360019093151-Managing-DNS-records-in-Cloudflare#h_60566325041543261564371

https://en.wikipedia.org/wiki/Reverse_proxy

You might be able to accomplish what you need with CloudFlare Page Rules, but I would just use Nginx. The idea is that a you point your A record at your proxy. Setup rules 'if URI was map.mydomain.com, forward to x.x.x.x on port 25775'. This way your users do not need to specify the port, the reverse proxy handles it.

I found a gist with an Nginx configuration to accomplish what you are looking for, but for port 8123

https://gist.github.com/2called-chaos/4eacb303b9491d1e374c

commented

It is good practice each machine on your network to have a it's own domain/subdomain. If yours does not, start by doing that.
Create an A record pointing to your server's IPv4 (without any ports). You can call this e.g. server1.mydomain.com. On a shared host, it is likely that there already is one e.g. node3.host.com, you could use this hostname if you know for sure it applies for your server.
Now create an SRV record named map.mydomain.com. Set the target to server1.mydomain.com and the port to 25775.

This will eliminate the necessity to specify the port upon connecting (map.mydomain.com:25775) and you can use map.mydomain.com directly.

If you have a server on which you are hosting your website, you could create a subdomain there. Create an index.html file and in it paste this code:

<iframe src="http://yourserverip:25775" style="border:none;position:absolute;top:0;left:0;width:100vw;height:100vh">Error loading content</iframe>

Bear in mind that Dynmap does not currently support SSL (https) so your iframe might be rejected to load if your subdomain enforces HTTPS. More about mixed content here

commented

It is good practice each machine on your network to have a it's own domain/subdomain. If yours does not, start by doing that.
Create an A record pointing to your server's IPv4 (without any ports). You can call this e.g. server1.mydomain.com
Now create an SRV record named map.mydomain.com. Set the target to server1.mydomain.com and the port to 25775.

This will eliminate the necessity to specify the port upon connecting (map.mydomain.com:25775) and you can use map.mydomain.com directly.

If you have a server on which you are hosting your website, you could create a subdomain there. Create an index.html file and in it paste this code:

<iframe src="http://yourserverip:25775" style="border:none;position:absolute;top:0;left:0;width:100vw;height:100vh">Error loading content</iframe>

Bear in mind that Dynmap does not currently support SSL (https) so your iframe might be rejected to load if your subdomain enforces HTTPS.

This is bad advice, browsers do not support srv records so setting up and srv* record to hide the port will not work.
I also don't recommend using an iframe- they are depreciated and most browser reject them because of that.

commented

It is good practice each machine on your network to have a it's own domain/subdomain. If yours does not, start by doing that.
Create an A record pointing to your server's IPv4 (without any ports). You can call this e.g. server1.mydomain.com
Now create an SRV record named map.mydomain.com. Set the target to server1.mydomain.com and the port to 25775.
This will eliminate the necessity to specify the port upon connecting (map.mydomain.com:25775) and you can use map.mydomain.com directly.
If you have a server on which you are hosting your website, you could create a subdomain there. Create an index.html file and in it paste this code:

<iframe src="http://yourserverip:25775" style="border:none;position:absolute;top:0;left:0;width:100vw;height:100vh">Error loading content</iframe>

Bear in mind that Dynmap does not currently support SSL (https) so your iframe might be rejected to load if your subdomain enforces HTTPS.

This is bad advice, browsers do not support srv records so setting up and saving record to hide the port will not work.
I also don't recommend using an iframe- they are depreciated and most browser reject them because of that.

iframes are not deprecated and supported on all major browsers.
image
image
Source: MDN Docs

commented

Iframe aren't but you aren't using iframes correctly if you are trying to serve http content vian an iframe to a https website

There are few reasons dynmap should be in an iframe and I wouldn't recommend them to someone trying to mask the port ever. Set up a reverse proxy or external platform controller like the wiki recommends. Then you can bind directly to 80/443 and have a much more robust config