Update TheHive Service Configuration#
Modify TheHive service configuration to fit your requirements.
Maintenance window required
This procedure involves changing configuration files and restarting services. Schedule a maintenance window to prevent service disruption.
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.addressandhttp.portto control how the service listens on the host. - Use
application.baseUrlto define the public URL that TheHive communicates to clients.
-
Stop TheHive service.
Service commands
For stop/restart commands depending on your installation method, refer back to the relevant installation guide.
-
Open the
application.conffile 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.conffile. -
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.addressandhttp.portto control how the service listens on the host. - Use
application.baseUrlto define the public URL that TheHive communicates to clients.
-
Stop TheHive service.
Service commands
For stop/restart commands depending on your installation method, refer back to the relevant installation guide.
-
Open the
application.conffile using a text editor. -
Update the following line:
[..] # Service configuration application.baseUrl = "http://localhost:9000" [..]Replace
http://localhost:9000with the actual public URL that users will use to access TheHive.Mandatory elements#
- Protocol: Either
httporhttps, depending on whether you configured HTTPS using a reverse proxy. - Host name: 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
80for HTTP and443for 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.conffile. -
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.
Service commands
For stop/restart commands depending on your installation method, refer back to the relevant installation guide.
-
Open the
application.conffile 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.conffile. -
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.
Service commands
For stop/restart commands depending on your installation method, refer back to the relevant installation guide.
-
Open the
application.conffile using a text editor. -
Add the following configuration:
stream.longPolling.refresh: 45 secondsThis setting determines how often TheHive refreshes long-polling connections to prevent proxy timeouts.
-
Save your modifications in the
application.conffile. -
Restart TheHive service.