• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Access web based applications using an alias instead of a port

Scheduled Pinned Locked Moved General pfSense Questions
26 Posts 4 Posters 5.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    Heli0s
    last edited by Sep 26, 2014, 2:07 AM

    I have a few apps, some are python based, while other are .NET based. They all start by running an executable. They simply have a web frontend as opposed to a "regular" application GUI. Since they're running as a Windows process, I can't really point to a web directory (/www/htdocs/).

    1 Reply Last reply Reply Quote 0
    • ?
      A Former User
      last edited by Sep 26, 2014, 2:16 AM

      How are the web front ends rendered? They have to be somewhere that's accessing by the webserver, unless they do their own serving outside the webserver. In that case, put all the frontends in separate directories using virtual hosts, and point them to their required executables. Which is bad, but that's another story. If they do their own serving then this rules out my suggestions.

      1 Reply Last reply Reply Quote 0
      • P
        PiBa
        last edited by Sep 26, 2014, 3:07 PM

        @PiBa:

        If http://<server>:8081/app1/ does 'work' then you must make sure that the httpchk also uses that url to perform the checks fill in the 'Http check URI' with '/app1/'</server>

        1 Reply Last reply Reply Quote 0
        • H
          Heli0s
          last edited by Sep 27, 2014, 5:03 AM

          Oops I missed that sentence :) So everything works now! I'm getting a good health check. The issue though is that when I go to http://app1, it takes me to http://<server>:<port>, instead of http://<server>:<port>/app1. Where can I add the /app1 part?</port></server></port></server>

          1 Reply Last reply Reply Quote 0
          • P
            PiBa
            last edited by Sep 27, 2014, 2:15 PM

            Hope this helps, put the code in the 'Backend pass thru':

            Code to change a request from / to /app1/

            reqirep  ^([^\ :]*)\ /(.*) \1\ /app1/\2
            

            If urls in the response contain absolute urls it might be required to use this:

            acl    no_redir url_beg   /app1/
            reqirep  ^([^\ :]*)\ /(.*) \1\ /app1/\2 if !no_redir
            

            The code makes sure that the method and url-path behind the / stays the same. Which method you need exactly might depend on the application thats running.
            For readability of the above how change a request from /app1/ to /app1/app1redir/

            reqirep  ^([^\ :]*)\ /app1/(.*) \1\ /app1/app1redir/\2
            

            If those above dont work you might still be able to get a acceptable workaround by using a redirect:

            acl    no_redir url_beg   /app1/
            http-request redirect location http://%[req.hdr(Host)]/app1/ if !no_redir
            
            

            Actually most of this info can be found in the manual, have you seen it?: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html

            1 Reply Last reply Reply Quote 0
            • H
              Heli0s
              last edited by Oct 1, 2014, 2:29 AM

              Everything works great! Thank you so much for all your help!

              1 Reply Last reply Reply Quote 0
              26 out of 26
              • First post
                26/26
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received