Forum OpenACS Q&A: Re: When using the revproxy module, how to rewrite the form

Hi Tony,

the reverse proxy module can be used in various setups such as to implement a virtual server, or just to redirect certain requests to a certain server (after having e.g. performed OpenACS permission checking), etc. For example, we have small module for making elasticsearch/kibana charts available in OpenACS, which are e.g. only accessible to community admins.

Below is the full definition of the fisheye integration at openacs.org, where all requests are redirected to a backend service. This happens for GET PUT and POST requests.

all the best -g

########################################################################
# reverse proxy as separate server for CVS Repository Viewer
########################################################################
ns_section "ns/servers" {
        ns_param cvs                    "CVS Repository Viewer"
}
ns_section ns/module/nssock/servers {
        ns_param        cvs             fisheye.openacs.org
        ns_param        cvs             cvs.openacs.org
}
ns_section ns/module/nsssl/servers {
        ns_param        cvs             fisheye.openacs.org
        ns_param        cvs             cvs.openacs.org
}
ns_section ns/server/cvs {
        ns_param        minthreads      5 
}

ns_section ns/server/cvs/tcl {
        ns_param        library         /home/fisheye/naviserver
}

ns_section ns/server/cvs/modules {
    ns_param revproxy   tcl
    ns_param nslog      nslog.so 
}

ns_section "ns/server/cvs/module/revproxy" {
    ns_param filters {
        ns_register_filter postauth GET    /* ::revproxy::upstream -target http://127.0.0.1:8060/
        ns_register_filter postauth POST   /* ::revproxy::upstream -target http://127.0.0.1:8060/
        ns_register_filter postauth PUT    /* ::revproxy::upstream -target http://127.0.0.1:8060/
  }
}
ns_section ns/server/cvs/module/nslog {
        ns_param        file                    ${logroot}/access-fisheye.log
        ns_param        logpartialtimes true 
        ns_param        logthreadname   true
}