Norconex / jef-monitor

Web-based application for monitoring jobs progress (created with JEF).
4 stars 3 forks source link

Bug - Jef-monitor uses absolute paths and so requires extra care behind proxies #7

Open danizen opened 7 years ago

danizen commented 7 years ago

Using mod_substitute to substitute on the body almost worked for me. My proxy looked like this:

    <Location /jef>
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set Host "occspydev.nlm.nih.gov"
        ProxyPass http://localhost:8082
        ProxyPassReverse http://localhost:8082
        Options -MultiViews
        Order allow,deny
        Allow from 130.14.160.225/24

        AddOutputFilterByType SUBSTITUTE text/html
        Substitute "s,id=\"instanceJobs\" src=\"/jobs\",id=\"instanceJobs\" src=\"jobs\",n"
   </Location>

Before adding the substitution with mod_substitute, there was an error since the body attempts to load from "/jobs" (absolute on host) rather than "jobs" (relative on host).

After that, Chrome blocked it as "mixed content", because this host is using HTTPS, as now required by the federal government. I gather that Javascript in the page may not be respecting the url scheme of the page, and so it is beyond me fixing it.