From c5f85e89a414c171a1d0d855d2f6b1b372da9937 Mon Sep 17 00:00:00 2001 From: Barath Kumar R Date: Tue, 12 Jan 2021 20:24:28 +0530 Subject: [PATCH] Fetching the location from API changed to proxy * The location based search for DC API is changed based on the proxy rule Change-Id: I30b1fc328787474def41de5997dce27d767e0d84 Signed-off-by: Barath Kumar R --- nginx/nginx.conf | 6 ++++++ proxy.conf.json | 5 +++++ src/environments/environment.prod.ts | 3 +-- src/environments/environment.ts | 3 +-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 1d3f29d..d168aa1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -28,6 +28,12 @@ server { proxy_set_header Accept-Encoding ""; } + location /api { + proxy_pass https://photon.komoot.de; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_set_header Accept-Encoding ""; + } + location / { try_files $uri $uri/ /index.html; } diff --git a/proxy.conf.json b/proxy.conf.json index e6a63c6..40b53f6 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -3,5 +3,10 @@ "target": "https://nbi:9999", "secure": false, "logLevel": "info" + }, + "/api/*": { + "target": "https://photon.komoot.de", + "secure": false, + "logLevel": "info" } } \ No newline at end of file diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 55697ed..0e734b9 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -53,8 +53,7 @@ export const environment = { packageSize: 50, paginationNumber: 10, //Possible values are 10, 25, 50, 100 packageVersion: version, - // tslint:disable-next-line: no-http-string - MAPLATLONGAPI_URL: 'http://photon.komoot.de/api/?q={value}&limit=5', + MAPLATLONGAPI_URL: 'api/?q={value}&limit=5', GENERATETOKEN_URL: OSM_ADMIN_ENDPOINT + 'tokens', PROJECTS_URL: OSM_ADMIN_ENDPOINT + 'projects', USERS_URL: OSM_ADMIN_ENDPOINT + 'users', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 92b5193..ce65d13 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -53,8 +53,7 @@ export const environment = { packageSize: 50, paginationNumber: 10, //Possible values are 10, 25, 50, 100 packageVersion: version, - // tslint:disable-next-line: no-http-string - MAPLATLONGAPI_URL: 'http://photon.komoot.de/api/?q={value}&limit=5', + MAPLATLONGAPI_URL: 'api/?q={value}&limit=5', GENERATETOKEN_URL: OSM_ADMIN_ENDPOINT + 'tokens', PROJECTS_URL: OSM_ADMIN_ENDPOINT + 'projects', USERS_URL: OSM_ADMIN_ENDPOINT + 'users', -- 2.25.1