Nginx Reverse Proxy



  • Hey Guys.

    I am wanting to setup reverse proxy so I can hide my myraid of web services running on different ports behind my domain name.

    at the moment I have a alias setup for example.com to redirect to 10.10.10.1(Web server where web services reside) so each web service which runs on other ports I access as follows:

    example.com:1111
    example.com:1112
    example.com:1113
    etc

    Forwarding these ports to the relevant hosts allows the same experience when using the domain name inside or outside of my network.

    How what I am trying to do is do away with the ports and be able to access the services as follows:

    example.com/service1
    example.com/service2
    example.com/service3

    How is this done with nginx with pfsense 2.3? or do I still have to use something like squid? I have tried and tried in the past but have struggled and it has never worked.



  • You can do this with Nginx, just google "nginx reverse proxy".  I will say I prefer apache, but that's because it's the httpd server I started with back when I didn't understand anything about the internet.

    after a quick search I found: https://www.nginx.com/resources/admin-guide/reverse-proxy/ which looks to be a thorough guide and should help you on your way.  You don't mention anything about SSL though but IIRC the guide covers that as well.