Accessing specific port on IP address

Hi folks. I am entirely self taught so please bear with me and my description. I am using pfSense at home. I have configured the DNS Resolver so that I can use my own local domain to access websites. I am running plex within the network and it uses port 32400. What are the settings within pfSense that I would use to allow plex.home to access plex.home:32400? I simply do not want to have the port number a required entry. Again, this is only within the LAN. I do not have plans to open up ports to the outside. Thanks in advance for the help.

I did this using my Apache server as a proxy, if you find a solution with pfsense please post.

2 Likes

Haven’t tried it but you could probably move the pfsense webui to another port and then port forward the internal address to the correct port on your plex server but this will be alot of config and i don’t know if it is worth it.

Looks like it’s not possible with just pfsense.

Would you mind describing how you do it with an Apache server. I am running a hypervisor and could “easily” accomplish this.

I only know how to do it with nginx. But google reverse proxy or 301 HTTP forwarding youll find it.

You can also use nginx then your config would look something like

server {
    listen 80;
    server_name plex.home;
    return 301 yourplex-ip:port
}

301 is a http code for redirect. So if you do it in this manner it wont stay plex.home, but rather just redirect you to your plex server. With a reverse proxy you could achieve this in a way that the server wont send back a 301 response but rather forward it to your plex server and rewrite some things, that need to be rewritten, take the response from plex and send it back to the client (all that rewriting you have to configure manually too). If you don`t require it. You don´t have to go threw that.

Not sure if you can even do it like that in apache I only know for sure that you can route sub routes so ip_or_name/plex it would be then. Id imagine it can. Though, I never did it and in nginx it’s easy and it’s supposedly more lightweight (although who cares in case). So I’d recommend nginx.

So I’ve done redirecting with both apache and nginx, depending on how heavily you want to use them, they could look somewhat like these.

apache

<VirtualHost *:443>                                                                                                                                                                                                                                      
    ServerName plex.nexii.ca                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                     
    <Proxy *>                                                                                                                                                                                                                                            
        Order deny,allow                                                                                                                                                                                                                                 
        Allow from all                                                                                                                                                                                                                                   
    </Proxy>                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                     
    <Location />                                                                                                                                                                                                                                         
        ProxyPass http://192.168.X.X:32400/                                                                                                                                                                                                              
        ProxyPassReverse http://192.168.X.X:32400/                                                                                                                                                                                                       
    </Location>                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                     
SSLCertificateFile /whereever/cert.crt                                                                                                                                                                                                       
SSLCertificateKeyFile /whereever/key.key                                                                                                                                                                                                
Include /whereever/options-ssl-apache.conf                                                                                                                                                                                                         
SSLCertificateChainFile /whereever/chain.ca-bundle                                                                                                                                                                                           
</VirtualHost>      

For nginx, what @maximal listed should be sufficient unless you want to do HTTPS, which requires a different setup. My apache settings does have HTTPS enabled, but a bit of tweaking and reading on documentation should make it suitable for HTTP.