0

I have a Raspberry Pi with some applications running, that require me to access a web interface.

I was wondering how I could basically connect to those web interfaces from outside my home-network, over a custom domain.

So for example, I'd like to visit heywhatsmypidoing.com/webmin to access my webmin, which I would normally visit by going to 192.168.0.1:10000.

I already have a domain name, but I have no idea where to go next.

unor
  • 3,066
  • 3
  • 27
  • 54
Raaabiiin
  • 25
  • 5
  • you need to forward ports, so the easy way to address the service (once you have forwarded port 10000 out to the outside on port 10000) would be http://heywhatsmypidoing.com:10000/webmin . if its the only service you are port forwarding (you don't have a webserver) you could map port 80 on the outside to 10000 on the inside and just use http://heywhatsmypidoing.com/webmin , but that only works because your browser sends everything to port 80 unless it is otherwise specified. – Frank Thomas Dec 28 '17 at 16:33
  • 1
    There have been several questions on this topic here on SuperUser. Here's one to start with: https://superuser.com/questions/1112193/why-cant-i-access-my-web-server-from-outside-the-network?rq=1 – music2myear Dec 28 '17 at 16:53

1 Answers1

1

You want a reverse proxy. Basically, you would set up a web server (on your Pi or elsewhere) such as Apache or Nginx to listen on port 80 (http) and have special entries to point to your local service IP/ports. In Apache this might look something like:

<VirtualHost *:80>
    Server Name heywhatsmypidoing.com
    # ServerAlias www.heywhatsmypidoing.com
    DocumentRoot "/www/example1"

    # ProxyPreserveHost On
    ProxyPass /webmin http://192.168.0.1:10000
    ProxyPassReverse /webmin http://192.168.0.1:10000

    # Other directives here
</VirtualHost>

Regardless of choice, you should be able to find some tutorials to help you set up either Apache or Nginx in this capacity for the Pi. I would recommend setting up a basic publicly available web server first and making sure it works before attempting any kind of proxying.

Notes

  • While port forwarding can be used in conjunction with a reverse proxy, it shouldn't be required (with the possible exception of port 80).

  • In some instances, you may need to proxy more than one URL for the same application (e.g. http://192.168.0.1:10000 and 192.168.0.1:10000/web)

  • Trailing slashes can be important. For Apache specifically, this applies especially to the second argument in the example above. I don't know what webmin requires, but certain applications may need e.g. http://192.168.0.1:10000 or http://192.168.0.1:10000/ depending on circumstances.

Anaksunaman
  • 16,718
  • 4
  • 38
  • 45