{"id":1384,"date":"2025-10-10T15:02:30","date_gmt":"2025-10-10T08:02:30","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/?post_type=docs&#038;p=1384"},"modified":"2025-11-12T15:04:12","modified_gmt":"2025-11-12T08:04:12","slug":"appproxy","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/axws7\/services-2\/appproxy\/","title":{"rendered":"AppProxy"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"appproxy\">AppProxy<\/h1>\n\n\n\n<p>\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e02\u0e2d\u0e07&nbsp;<a href=\"https:\/\/github.com\/Esri\/resource-proxy\" target=\"_blank\" rel=\"noreferrer noopener\">resource proxy<\/a>&nbsp;\u0e16\u0e39\u0e01\u0e19\u0e34\u0e22\u0e32\u0e21\u0e44\u0e27\u0e49\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e32\u0e01\u0e23\u0e02\u0e49\u0e32\u0e21\u0e42\u0e14\u0e40\u0e21\u0e19 (CORS)<\/li>\n\n\n\n<li>\u0e2a\u0e48\u0e07 Request \u0e17\u0e35\u0e48\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e22\u0e32\u0e27\u0e40\u0e01\u0e34\u0e19 2048 \u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23 \u0e2b\u0e23\u0e37\u0e2d Request \u0e41\u0e1a\u0e1a POST \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e33\u0e19\u0e27\u0e19\u0e21\u0e32\u0e01<\/li>\n\n\n\n<li>\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 Secure Map Service \u0e14\u0e49\u0e27\u0e22 Token Based Authentication<\/li>\n<\/ul>\n\n\n\n<p>\u0e22\u0e31\u0e07\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e2d\u0e35\u0e01 \u0e41\u0e15\u0e48\u0e02\u0e2d\u0e19\u0e33\u0e02\u0e49\u0e2d\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e2d\u0e07\u0e23\u0e39\u0e49\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e02\u0e2d\u0e07 Proxy Page \u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e04\u0e2d\u0e19\u0e1f\u0e34\u0e01-proxyconfig\">\u0e04\u0e2d\u0e19\u0e1f\u0e34\u0e01 proxy.config<\/h2>\n\n\n\n<p>\u0e44\u0e1f\u0e25\u0e4c\u0e04\u0e2d\u0e19\u0e1f\u0e34\u0e01\u0e02\u0e2d\u0e07 Proxy \u0e08\u0e30\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e42\u0e1f\u0e25\u0e4c\u0e40\u0e14\u0e2d\u0e23\u0e4c&nbsp;<code>Config<\/code>&nbsp;\u0e42\u0e14\u0e22 Development \u0e41\u0e25\u0e30 Production \u0e41\u0e22\u0e01\u0e44\u0e1f\u0e25\u0e4c\u0e04\u0e2d\u0e19\u0e1f\u0e34\u0e01\u0e01\u0e31\u0e19\u0e0a\u0e31\u0e14\u0e40\u0e08\u0e19<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>{\n  \"allowedReferrers\": &#91;\"https:\/\/atlasx.cdg.co.th\"&#93;,\n  \"tokenCacheMinutes\": 29,\n  \"serverUrls\": &#91;\n    {\n      \"url\": \"https:\/\/appserver2.cdg.co.th\/arcgis\/rest\/services\/AtlasX\/CITY\",\n      \"domain\": \"\",\n      \"username\": \"portaladmin\",\n      \"password\": \"portal123\"\n    },\n    {\n      \"url\": \"arcgis.com\",\n      \"clientId\": \"z3Cjsu3xPUEriYYq\",\n      \"clientSecret\": \"3691ba5e2f4747ccbe224477acca6a53\",\n      \"oauth2Endpoint\": \"https:\/\/www.arcgis.com\/sharing\/rest\/oauth2\/token\"\n    }\n  &#93;\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #A31515\">&quot;allowedReferrers&quot;<\/span><span style=\"color: #000000\">: &#91;<\/span><span style=\"color: #A31515\">&quot;https:\/\/atlasx.cdg.co.th&quot;<\/span><span style=\"color: #000000\">&#93;,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #A31515\">&quot;tokenCacheMinutes&quot;<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">29<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #A31515\">&quot;serverUrls&quot;<\/span><span style=\"color: #000000\">: &#91;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;url&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;https:\/\/appserver2.cdg.co.th\/arcgis\/rest\/services\/AtlasX\/CITY&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;domain&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;username&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;portaladmin&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;password&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;portal123&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;url&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;arcgis.com&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;clientId&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;z3Cjsu3xPUEriYYq&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;clientSecret&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;3691ba5e2f4747ccbe224477acca6a53&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;oauth2Endpoint&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;https:\/\/www.arcgis.com\/sharing\/rest\/oauth2\/token&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  &#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Key<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>allowedReferrers<\/td><td>\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07 Client \u0e17\u0e35\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 Proxy \u0e44\u0e14\u0e49 \u0e43\u0e19\u0e0a\u0e48\u0e27\u0e07 Development \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e1b\u0e47\u0e19&nbsp;<code>*<\/code>&nbsp;\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22 \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e1a\u0e19 Production \u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e2b\u0e49\u0e23\u0e30\u0e1a\u0e38 Domain Name \u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 Proxy \u0e44\u0e14\u0e49<\/td><\/tr><tr><td>tokenCacheMinutes<\/td><td>\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48 Token \u0e2b\u0e21\u0e14\u0e2d\u0e32\u0e22\u0e38 \u0e19\u0e31\u0e1a\u0e08\u0e32\u0e01\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48 Proxy \u0e2a\u0e23\u0e49\u0e32\u0e07 Token<\/td><\/tr><tr><td>serverUrls<\/td><td>Profile \u0e02\u0e2d\u0e07 Map Service \u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e17\u0e31\u0e49\u0e07 ArcGIS Server \u0e41\u0e25\u0e30 OAuth 2.0 \u0e02\u0e2d\u0e07 ArcGIS Online \u0e2b\u0e23\u0e37\u0e2d Portal<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --location --request GET 'https:\/\/atlasx.cdg.co.th\/axws-demo\/api\/AppProxy?https:\/\/appserver2.cdg.co.th\/arcgis\/rest\/services\/AtlasX\/CITY\/MapServer\/legend?f=pjson' \\\n--header 'referer: https:\/\/atlasx.cdg.co.th\/axws-demo' \\\n--header 'Content-Type: application\/x-www-form-urlencoded' \\\n--data-urlencode 'f=json'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">curl<\/span><span style=\"color: #000000\"> --<\/span><span style=\"color: #001080\">location<\/span><span style=\"color: #000000\"> --<\/span><span style=\"color: #001080\">request<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0070C1\">GET<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;https:\/\/atlasx.cdg.co.th\/axws-demo\/api\/AppProxy?https:\/\/appserver2.cdg.co.th\/arcgis\/rest\/services\/AtlasX\/CITY\/MapServer\/legend?f=pjson&#39;<\/span><span style=\"color: #000000\"> \\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">--<\/span><span style=\"color: #001080\">header<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;referer: https:\/\/atlasx.cdg.co.th\/axws-demo&#39;<\/span><span style=\"color: #000000\"> \\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">--<\/span><span style=\"color: #001080\">header<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;Content-Type: application\/x-www-form-urlencoded&#39;<\/span><span style=\"color: #000000\"> \\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">--<\/span><span style=\"color: #001080\">data<\/span><span style=\"color: #000000\">-<\/span><span style=\"color: #001080\">urlencode<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;f=json&#39;<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"featured_media":0,"parent":1369,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-1384","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=1384"}],"version-history":[{"count":4,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1384\/revisions"}],"predecessor-version":[{"id":3200,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1384\/revisions\/3200"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1369"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=1384"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}