mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Add backward compatibility for /ingestor route in Nginx and ProbeIngest; update Probe configuration for new URL structure
This commit is contained in:
parent
815ae7161d
commit
4fc2029a61
@ -563,6 +563,24 @@ server {
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
|
||||
# For backward compatibility with probes that are already deployed
|
||||
location /ingestor {
|
||||
# This is for nginx not to crash when service is not available.
|
||||
resolver 127.0.0.1 valid=30s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_pass http://probe-ingest;
|
||||
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
|
||||
location /server-monitor {
|
||||
# This is for nginx not to crash when service is not available.
|
||||
resolver 127.0.0.1 valid=30s;
|
||||
|
@ -18,7 +18,9 @@ if (
|
||||
!PROBE_INGEST_URL.toString().endsWith("probe-ingest") &&
|
||||
!PROBE_INGEST_URL.toString().endsWith("probe-ingest/")
|
||||
) {
|
||||
PROBE_INGEST_URL = URL.fromString(PROBE_INGEST_URL.addRoute("/probe-ingest").toString());
|
||||
PROBE_INGEST_URL = URL.fromString(
|
||||
PROBE_INGEST_URL.addRoute("/probe-ingest").toString(),
|
||||
);
|
||||
}
|
||||
|
||||
export const PROBE_NAME: string | null = process.env["PROBE_NAME"] || null;
|
||||
|
@ -1,6 +1,4 @@
|
||||
import IncomingRequestAPI from "../IncomingRequestIngest/API/IncomingRequest";
|
||||
import MonitorAPI from "./API/Monitor";
|
||||
import OTelIngestAPI from "./API/OTelIngest";
|
||||
import ProbeIngest from "./API/Probe";
|
||||
import RegisterAPI from "./API/Register";
|
||||
import ServerMonitorAPI from "./API/ServerMonitor";
|
||||
@ -20,12 +18,11 @@ const app: ExpressApplication = Express.getExpressApp();
|
||||
|
||||
const APP_NAME: string = "probe-ingest";
|
||||
|
||||
app.use([`/${APP_NAME}`, "/"], RegisterAPI);
|
||||
app.use([`/${APP_NAME}`, "/"], MonitorAPI);
|
||||
app.use([`/${APP_NAME}`, "/"], ProbeIngest);
|
||||
app.use([`/${APP_NAME}`, "/"], IncomingRequestAPI);
|
||||
app.use([`/${APP_NAME}`, "/"], OTelIngestAPI);
|
||||
app.use([`/${APP_NAME}`, "/"], ServerMonitorAPI);
|
||||
// "/ingestor" is used here for backward compatibility because probes are already deployed with this path in client environments.
|
||||
app.use([`/${APP_NAME}`, "/ingestor", "/"], RegisterAPI);
|
||||
app.use([`/${APP_NAME}`, "/ingestor", "/"], MonitorAPI);
|
||||
app.use([`/${APP_NAME}`, "/ingestor", "/"], ProbeIngest);
|
||||
app.use([`/${APP_NAME}`, "/ingestor", "/"], ServerMonitorAPI);
|
||||
|
||||
const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user