Hello, I’m having an issue getting a proxy in the ionic.config.json file to work correctly. My ionic.config.json looks like this:

{ "name": "myApp", "app_id": "512887ea", "type": "ionic-angular", "proxies": [ { "path": "/api/", "proxyUrl": "" } ], "integrations": { "cordova": {} } }

The proxy seems to be working properly when I make a http request to /api, but if I make a request to /api/ticker then the browser will just request http://ticker. @hich is where I get the net::ERR_NAME_NOT_RESOLVED error in the console.

So my question is, when requesting /api/ticker Shouldn’t the proxy be switching the url to

the proxy only works for domain name replacement. so adding the /v1 is breaking it. you have to put the v1 in your request

Thank you. So I’ve made some changes.

What I am trying to request is

I’ve now changed my proxy to

"proxies": [ { "path": "/v1", "proxyUrl": "" } ]

and my http request to /v1/ticker is showing the request URL in chrome dev tools as:


so it doesnt seem like the localhost domain is being replaced. I have also restarted and launched with ionic serve

when you do “ionic serve”

do you see

[20:56:54]  build dev started ... 
[20:56:54]  Proxy added:/v1 =>

during build process before display


[22:21:00] Proxy added:/v1 =>

ok, that confirms proxy is going, then it must be a Chrome issue,

I use firefox
ionic server -lab

maybe some help here

Unfortunately, the same issue occurred on firefox. still requesting /v1/ticker and getting http://localhost:8100/v1/ticker as the request.

what is the console error

GET http://localhost:8100/v1/ticker 404 (Not Found)

and from the network tab:

Request URL:http://localhost:8100/v1/ticker Request Method:GET Status Code:404 Not Found Remote Address: Referrer Policy:no-referrer-when-downgrade

this is a problem with the service you are trying to contact.

try a know open json web service to test

there is a great app called postman i have on my Mac, to test webservice

Thanks for bearing with me on this.

I have tried to replace the url in my configs to an entirely different url / api.

the api is a mock data api

In this case I am requesting:


and that is being finally requested in the browser as:

Request URL:http://localhost:8100/comments/1
Request Method:GET
Status Code:304 Not Modified
Remote Address:
Referrer Policy:no-referrer-when-downgrade

my proxy is :
{ "path": "/comments", "proxyUrl": "" }

oddly though the request to /comments does return a result.

so why do you think it does not work with the pattern is the same.

EDIT: I’m seeing that there is a 301 response in the "/v1/ticker" request:

Request URL:http://localhost:8100/v1/ticker
Request Method:GET
Status Code:301 Moved Permanently (from disk cache)
Remote Address:
Referrer Policy:no-referrer-when-downgrade

Response Headers
content-type:text/html; charset=utf-8
date:Sun, 12 Nov 2017 08:04:12 GMT

Request Headers
Provisional headers are shown
Accept:application/json, text/plain, */*
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko)Chrome/61.0.3163.100 Safari/537.36`

Is this confirming a problem with the service api.coinmarketcap?

After trying other API’s I belive that it was an issue with the specific API api.coinmarketcap. I wonder why that is though… Thanks for your help @Ben1nB1ack

actually I think it a CORS issue (a new addition to that)

I built a proxy on our server and I called the proxy url and the proxy called the service. etc.

So you were able to make it work on your end?

i revived old test project, set proxy and url and it worked
i use firefox
ionic serve --lab

import {Http, Headers, Response} from '@angular/http';

export class WscallPage {
webReturn: any;

  constructor(private http: Http) {

  callWebserviceTest2() {

  proxy setup
      "path": "/cm",
      "proxyUrl": ""

    const baseURL = '/cm/v1/ticker/'


      .map((res:Response) => res.json())
      .subscribe(res => {
        this.webReturn = res;






<ion-content padding>
  <p>WS Calling Page</p>

        <button ion-button (click)="callWebserviceTest2()">forum test</button>
        <p>Result: <br>
          <ion-scroll scrollY="true" scrollX="true">
            <pre>{{ webReturn | json}}</pre>



Unbelievably, your configuration does not work on my end, and I copied your proxy and request exactly. I am still getting the 301:

Request URL:http://localhost:8100/cm/v1/ticker
Request Method:GET
Status Code:301 Moved Permanently (from disk cache)

followed by the 401:

Request URL:http://localhost:8100/v1/ticker/
Request Method:GET
Status Code:404 Not Found
Remote Address:
Referrer Policy:no-referrer-when-downgrade

EDIT: that is, I tried the configuration in my current project, I’m not sure what would happen if I started a new project. I will try that now.

I created a new ionic project with the simplest possible configuration and it worked fine. I was able to get data from the request. I’ll have to look into this further.