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,196

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
  • 18,227