# How to Integrate with Apache Webserver or NGINX

# Integrating With Apache Webserver

To fulfill certain requirements, such as different authentication mechanisms or HTTPS support, Teamscale can be operated behind a webserver, such as Apache. One possible setup has Teamscale running on the same machine as the Apache server. For this, the teamscale.properties should contain the following two lines.

# teamscale.properties

server.urlprefix=teamscale
server.bind-hostname=localhost

This sets an explicit URL prefix to use and ensures that the instance is reachable only from the local machine (otherwise Apache could be circumvented). The Apache configuration then contains the following lines:

# Apache Configuration

ProxyPass	/teamscale
	http://localhost:8080/teamscale
ProxyPassReverse /teamscale
	http://localhost:8080/teamscale
ProxyRequests Off

# This is important, as otherwise some URLs are blocked
# by Apache
AllowEncodedSlashes On

Depending on your configuration and goals, slightly different and additional directives are required. Please refer to the Apache manual for more information.

# Integrating With NGINX

To fulfill certain requirements, such as different authentication mechanisms or HTTPS support, Teamscale can be operated behind a NGINX reverse proxy.

# NGINX Configuration

events {
	worker_connections 1024;
}

http {
	server {
        server_name teamscale_nginx;

        location /teamscale {
          proxy_pass http://localhost:8080;
        }
   }
}

When Teamscale is served with a prefix like in the above configuration /teamscale Teamscale must be adjusted accordingly. For this, the teamscale.properties should contain the following two lines.

# teamscale.properties

server.urlprefix=teamscale
server.bind-hostname=localhost

This sets an explicit URL prefix to use and ensures that the instance is reachable only from the local machine.

Depending on your configuration and goals, slightly different and additional directives are required. Please refer to the NGINX documentation for more information.