Hi
I have an VPS that has MikroTik CHR installed on it.
I want a simple Web Server to host my files in specific directories on this CHR.
I need to access these files and Download them with direct Domain Address (I created a DNS Record that is Point this VPS Public IP Address already) like this for example :
http(s)://sub.domain.com/dir/file.(txt)
Or something like that.
I know CHR is not meant to be a Web Server for such purposes,
But I need this for my personal use.
I would be appreciated if anyone help or guide me if there are any possible solutions.
Thanks
I watched this video before, But I want to access these file through Internet without authentication and connect to MikroTik network
Only using a Domain Link and some custom driectories
Something like this :
You can also add a simple web server on a computer (your preferred flavor of OS), or even a RaspBerry Pi on the LAN and port forward via NAT so it can be reached from the Internet.
You don't have to have any AUTH if you don't want to.
Pull the nginx image, duplicate your files into the mounted directory, run the instance, and next create a dst-nat rule which forwards the 80/TCP port to your container instance. Then, create a CNAME record with the content of your DDNS. If you want an HTTPS connection, then you could use Let Encrypt to create a valid certificate. However, you can utilize the Cloudflare CDN service.
The question started with: I have an VPS that has MikroTik CHR installed on it.
So to do it that way he would have to buy yet another VPS, probably not what he had in mind.
It seems that configuring “hotspot” installs a simple webserver, but I do not have experience with it to tell how useful it is.
Attention MikroTik enthusiasts! It’s time to explore the world of Containers! MikroTik’s implementation of Linux containers allows users to run containerized environments within RouterOS. This feature was introduced in version 7 of the operating system.
Personally, I’ve decided to leverage my MikroTik Cloud Hosted Router (CHR) to host my WordPress blog, complete with a multisite network. […]
"
You might also want to take a look at Caddyserver or Trafik container if it’s just static files (e.g. you don’t need Wordpress etc for content mgmt). Both have ACME built-in with Let’s Encrypt support in the container that largely automatic. See http://forum.mikrotik.com/t/container-traefik-on-rb5009/165849/6 for traefik. I don’t have writeup for caddyserver, but works on RouterOS container.
What I would do is create a Wireguard tunnel between the VPS and the mikrotik router.
The server and files would be hosted on the Mikrotik Router.
On the CHR I would port forward inquiries coming in externally from USers or in this case just the admin, to the VPS public IP or domain name/url etc…
They would be port forwarded into the tunnel,
DONE.
Assuming server is 192.168.0.25 and port 10101 on the MT router.
/ip firewall ( complete set of default rules except replace the forward chain rule associated with port forwarding to ) add action=accept chain=forward connection-nat-state=dstnat comment="allow port forwarding"add action=accept chain=forward in-interface=wireguard-vps out-interface=wireguard-vps comment=“relay for remote users to MT Router”
add action=accept chain=forward in-interface-list=wireguard-vps out-interface-list=WAN { allows remote users or users on MT to use VPS internet if required } add action=drop chain=forward comment=“Drop all else”
Probably want to also add an input chain rule add chain=input action=accept in-interface=wireguard-vps comment='remote or MT Router admin config access to VPS"
/ip firewall nat
add chain=srcnat action=scrnat out-interface=wan to-address=static VPS public IP add chain=dstnat action=dst-nat dst-address=vps public IP dst-port=10101 protocol=tcp to-address=192.168.0.25