How to Change the Port of the Analytics Server
Reassign the Analytics Server to a different port and update Nginx routing so ServiceOps continues to serve reports, dashboards, and widgets without interruption.
The Analytics Server runs on port 8081 by default. You may need to change this port to resolve a conflict with another service on the same host or to align with your organization's port allocation policy. This guide covers the full change: updating the Analytics Server configuration, updating every Nginx proxy rule that references the old port, and verifying the service after restart.
Prerequisites
- Root or
sudoaccess on the ServiceOps server - A confirmed available port that does not conflict with any running service (see the port reference table below)
- A maintenance window, as restarting services will briefly interrupt Analytics features
Default port assignments in a standard ServiceOps deployment:
| Port | Service |
|---|---|
8080 | Main Backend (ServiceOps) |
8081 | Analytics Server (default) |
8082 | Discovery Server |
8000 | Chat Server |
6060 | File Server |
5432 | PostgreSQL |
6379 | Redis |
80 / 443 | Nginx |
Do not assign a port already in use by another service. Assigning a conflicting port will prevent the Analytics Server from starting and may break reports and dashboards.
Steps
Step 1: Configure the New Port on the Analytics Server
Open the Analytics Server properties file and set the new port.
Open the configuration file:
vi /opt/flotomate/cm-analytics/application-custom.propertiesAdd or update the
server.portproperty:server.port=<new-port>Example: To move the Analytics Server to port
8083:server.port=8083Save and close the file.
Step 2: Update the Nginx Configuration
The Nginx configuration at /etc/nginx/conf.d/fmt_nginx.conf contains multiple proxy_pass directives that route Analytics traffic to the old port. Update every one of them to the new port.
Open the file:
vi /etc/nginx/conf.d/fmt_nginx.conf
Update all Analytics proxy rules as listed in the table below:
| Nginx Location | Old proxy_pass | New proxy_pass |
|---|---|---|
/api/analytics/report/download | http://localhost:<old-port>/api/analytics/report/download | http://localhost:<new-port>/api/analytics/report/download |
/api/analytics/public/(.*)/chart | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/download | http://localhost:<old-port>/api/analytics/download | http://localhost:<new-port>/api/analytics/download |
/api/analytics | http://localhost:<old-port>/api/analytics | http://localhost:<new-port>/api/analytics |
/api/analytics/download/.+/list | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/report/.+/preview | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/widget/preview | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/widget/download | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/download/dashboard/print | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/public/user_survey_response/widget/preview | http://localhost:<old-port> | http://localhost:<new-port> |
/api/analytics/download/print | http://localhost:<old-port> | http://localhost:<new-port> |
Do not change the location /api block that proxies to http://localhost:8080/api. That block routes traffic to the Main Backend, not the Analytics Server.
Nginx Location Reference
The 11 Analytics location blocks and their purpose:
- Report Download —
location /api/analytics/report/download - Public Chart API —
location ~ /api/analytics/public/(.*?)/chart - Analytics Download —
location /api/analytics/download - Main Analytics API —
location /api/analytics - Download List (Regex) —
location ~ ^/api/analytics/download/.+/list$ - Report Preview —
location ~ ^/api/analytics/report/.+/.+/preview$ - Widget Preview —
location /api/analytics/widget/preview - Widget Download —
location /api/analytics/widget/download - Dashboard Print —
location /api/analytics/download/dashboard/print - Public Survey Widget Preview —
location /api/analytics/public/user_survey_response/widget/preview - Print Download —
location /api/analytics/download/print
Before and After Example (Port 8081 to Port 8082)
The example below shows the complete Nginx configuration before and after changing the Analytics Server port from 8081 to 8082.
Before (port 8081):
location /api/analytics {
proxy_pass http://localhost:8081/api/analytics;
}
location /api/analytics/report/download {
proxy_pass http://localhost:8081/api/analytics/report/download;
}
location /api/analytics/download {
proxy_pass http://localhost:8081/api/analytics/download;
}
location ~ /api/analytics/public/(.*?)/chart {
proxy_pass http://localhost:8081;
}
location ~ ^/api/analytics/download/.+/list$ {
proxy_pass http://localhost:8081;
}
location ~ ^/api/analytics/report/.+/.+/preview$ {
proxy_pass http://localhost:8081;
}
location /api/analytics/widget/preview {
proxy_pass http://localhost:8081;
}
location /api/analytics/widget/download {
proxy_pass http://localhost:8081;
}
location /api/analytics/download/dashboard/print {
proxy_pass http://localhost:8081;
}
location /api/analytics/public/user_survey_response/widget/preview {
proxy_pass http://localhost:8081;
}
location /api/analytics/download/print {
proxy_pass http://localhost:8081;
}
After (port 8082):
location /api/analytics {
proxy_pass http://localhost:8082/api/analytics;
}
location /api/analytics/report/download {
proxy_pass http://localhost:8082/api/analytics/report/download;
}
location /api/analytics/download {
proxy_pass http://localhost:8082/api/analytics/download;
}
location ~ /api/analytics/public/(.*?)/chart {
proxy_pass http://localhost:8082;
}
location ~ ^/api/analytics/download/.+/list$ {
proxy_pass http://localhost:8082;
}
location ~ ^/api/analytics/report/.+/.+/preview$ {
proxy_pass http://localhost:8082;
}
location /api/analytics/widget/preview {
proxy_pass http://localhost:8082;
}
location /api/analytics/widget/download {
proxy_pass http://localhost:8082;
}
location /api/analytics/download/dashboard/print {
proxy_pass http://localhost:8082;
}
location /api/analytics/public/user_survey_response/widget/preview {
proxy_pass http://localhost:8082;
}
location /api/analytics/download/print {
proxy_pass http://localhost:8082;
}
Save and close the file.
Step 3: Test the Nginx Configuration
Before restarting, validate the Nginx configuration syntax to catch any errors:
nginx -t
A successful test produces:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Do not proceed to the next step if nginx -t reports errors. Fix any syntax issues first.
Step 4: Restart Services
Restart the Analytics Server and reload Nginx to apply the changes:
systemctl restart ft-analytics-server
nginx -s reload
Step 5: Verify the Change
Confirm the Analytics Server is listening on the new port and responding correctly:
ss -tulnp | grep <new-port>
Then test the Analytics API endpoint directly:
curl http://localhost:<new-port>/api/analytics
A valid JSON response confirms the server is up and routing correctly.
Result
The Analytics Server runs on the new port. Nginx routes all Analytics API requests, including report downloads, dashboard print, widget previews, and public chart endpoints, to the new port. Reports and dashboards in the Technician Portal load without errors.
Troubleshooting
Analytics Server fails to start after the port change
Cause: The new port is already in use by another process.
Fix: Run ss -tulnp | grep <new-port> to identify the conflicting process. Choose a different port that is not in the default port table, update application-custom.properties with the new value, and restart the service.
Reports or dashboards return errors after the change
Cause: One or more proxy_pass entries in fmt_nginx.conf still reference the old port, or the Nginx reload was not applied.
Fix: Run grep <old-port> /etc/nginx/conf.d/fmt_nginx.conf to find any remaining references. Update them to the new port, run nginx -t to validate, and then run nginx -s reload.
nginx -t reports a syntax error after editing fmt_nginx.conf
Cause: A proxy_pass line was edited incorrectly, such as a missing semicolon or malformed URL.
Fix: Run nginx -T | grep analytics to inspect all Analytics-related directives. Compare each line against the reference configuration in Step 2 and correct any formatting errors before reloading.