Skip to content

Commit

Permalink
Merge pull request #519 from opengeospatial/issue#418
Browse files Browse the repository at this point in the history
Issue#418
  • Loading branch information
dstenger committed May 20, 2022
2 parents d953440 + 46a7c53 commit 6307da1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/site/markdown/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,11 @@ directory can be modified to provide site-specific content:
- **site/welcome.txt**: The main text.
- **site/footer.txt**: Footer content.
- **site/title.html**: Title of the web application

### TEAM Engine behind a reverse proxy

If you run TEAM Engine behind a reverse proxy using HTTPS, you will need to configure your proxy as described in the following:

Configure your proxy to add the **x-forwarded-proto** header, with value **https**, to any requests that are forwarded to the TEAM Engine.


Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class TestServlet extends HttpServlet {
public static final String CTL_NS = "http://www.occamlab.com/ctl";
/** Alias is declared in the web app Context element. */
private static final String ABOUT_ALIAS = "about/";
private static final String X_FORWARDED_PROTO = "X-Forwarded-Proto";

private static Logger LOGR = Logger
.getLogger("com.occamlab.te.web.TestServlet");
Expand Down Expand Up @@ -363,7 +364,11 @@ public void process(HttpServletRequest request, HttpServletResponse response)
opts.setBaseURI(baseURL.toString());
TECore core = new TECore(engine, indexes.get(opts
.getSourcesName()), opts);
String servletURL = request.getRequestURL().toString();
String scheme = request.getHeader(X_FORWARDED_PROTO);
if( scheme == null) {
scheme = "http";
}
String servletURL = scheme + "://" + request.getServerName() + (request.getServerPort() != 80 ? ":" + request.getServerPort() : "") + request.getRequestURI();
LOGR.fine("Request URL is " + servletURL);
core.setTestServletURL(servletURL);
MonitorServlet.setBaseServletURL(servletURL.substring(0,
Expand Down

0 comments on commit 6307da1

Please sign in to comment.