Update TheHive Service Configuration#
Modify TheHive service configuration to fit your requirements.
Update the listen address and port#
By default, TheHive listens on all network interfaces (0.0.0.0)
on port 9000
. You can change these settings to control how TheHive listens internally on the host.
Difference from the base URL
The listen address and port are independent of the public URL defined in application.baseUrl
.
- Use
http.address
andhttp.port
to control how the service listens on the host. - Use
application.baseUrl
to define the public URL that TheHive communicates to clients.
-
Stop TheHive service.
-
Open the
application.conf
file using a text editor. -
Add the following configuration:
http.address=127.0.0.1 http.port=9000
-
Modify the values according to your requirements.
-
Save your modifications in the
application.conf
file. -
Restart TheHive service.
Update the base URL#
The base URL defines the public address that users access to reach TheHive. This setting tells TheHive how to generate URLs for clients.
Role of the base URL
The public URL defined in application.baseUrl
is independent of the service’s listening address and port.
- Use
http.address
andhttp.port
to control how the service listens on the host. - Use
application.baseUrl
to define the public URL that TheHive communicates to clients.
-
Stop TheHive service.
-
Open the
application.conf
file using a text editor. -
Update the following line:
[..] # Service configuration application.baseUrl = "http://localhost:9000" [..]
Replace
http://localhost:9000
with the actual public URL that users will use to access TheHive.Mandatory elements#
- Protocol: Either
http
orhttps
, depending on whether you configured HTTPS using a reverse proxy. - Hostname: The DNS name or IP address that users enter in their browser.
Optional elements#
- Port: The network port where TheHive is exposed. Include a port only when the public URL uses a non-standard port. Standard ports are
80
for HTTP and443
for HTTPS. - Path segments: Needed if TheHive runs behind a reverse proxy under a subpath.
Service configuration examples
-
Root domain:
Without explicit port:
application.baseUrl = "https://thehive.example.org" play.http.context = "/"
With explicit port:
application.baseUrl = "https://thehive.example.org:9000" play.http.context = "/"
-
Custom path behind a reverse proxy:
Without explicit port:
application.baseUrl = "https://example.org/thehive" play.http.context = "/thehive"
With explicit port:
application.baseUrl = "https://example.org:9000/thehive" play.http.context = "/thehive"
- Protocol: Either
-
Save your modifications in the
application.conf
file. -
Restart TheHive service.
Set a context path#
Configure a context path when TheHive runs behind a reverse proxy under a specific URL path.
-
Stop TheHive service.
-
Open the
application.conf
file using a text editor. -
Update the following line:
[..] # Service configuration play.http.context = "/" [..]
Replace
/
with your desired context path.For example:
play.http.context: "/thehive"
Service configuration examples
-
Root domain:
Without explicit port:
application.baseUrl = "https://thehive.example.org" play.http.context = "/"
With explicit port:
application.baseUrl = "https://thehive.example.org:9000" play.http.context = "/"
-
Custom path behind a reverse proxy:
Without explicit port:
application.baseUrl = "https://example.org/thehive" play.http.context = "/thehive"
With explicit port:
application.baseUrl = "https://example.org:9000/thehive" play.http.context = "/thehive"
-
-
Save your modifications in the
application.conf
file. -
Restart TheHive service.
Configure streams for reverse proxies#
Reverse proxies like nginx can cause 504 Gateway Time-Out
errors with TheHive long-polling requests. Configure the refresh interval to prevent these timeouts.
-
Stop TheHive service.
-
Open the
application.conf
file using a text editor. -
Add the following configuration:
stream.longPolling.refresh: 45 seconds
This setting determines how often TheHive refreshes long-polling connections to prevent proxy timeouts.
-
Save your modifications in the
application.conf
file. -
Restart TheHive service.