After updating to ionic version 2.1.12 proxy settings are not working anymore. When calling paths defined in ionic.config.json, they end up pointing to the url at which the ionic server is running (i.e itself), and thus respond with 404 Not Found.
Yep, there was a bug in app-script. I think the fix is now merged so I guess it gonna be release with next version of app-script aka 0.0.46
Hi!!!
HEEELLLPP MEEE!! Iâve update my ionic2 and the proxy has stoped as well!
Can somebody help me? I need to deploy a new version next Saturday rs!
Thanks!!!
The last version of app-script (0.0.46) resolve the problem of proxy aka the proxies listed in ionic.config.json are supported again
Iâve just updated my ionic and it still does not work, where can I see this âapp-script (0.0.46)â?
Thank you a lot!
In your package.json you should find
"devDependencies": {
"@ionic/app-scripts": "0.0.46",
The proxies should be configured in ionic.config.json like
"proxies": [{
"path": "/mycontext/mysubcontext/etc",
"proxyUrl": "https://myserver.com/mycontext/mysubcontext/etc"
},{
....
I did exactly the same but it keep point to http://localhost:8100/mycontext/mysubcontext. Do you know what else I need?
thanks,
In your classes you are calling http://localhost:8100/⌠right ?
yeah, in the class, I only call relative path. so the call url should be like this â/mycontext/mysubcontextâ and convert to http://localhost:8100/mycontext/mysubcontext in network tab but it doesnt show https://myserver.com/mycontext/mysubcontext/etc
Could you post here a sample of code and details? Also how does your ionic.config.json look like and which app-scrip version are you using ?
Itâs solved the problem!! Thank you a lot!!
I am having the same problem. I tried whatâs suggested here (adding app-scripts 0.0.46) and still no luck.
Hereâs my ionic.config.json:
{
ânameâ: âtestâ,
âapp_idâ: ââ,
âproxiesâ: [
{
âpathâ: â/api_path/â,
âproxyUrlâ: âhttp://localhost/test/apiâ
}
],
âdefaultBrowserâ: âchromium-browserâ
}
Hereâs my package.json:
{
ânameâ: âtestâ,
âversionâ: â1.1.1â,
âdescriptionâ: âtest: An Ionic projectâ,
âdependenciesâ: {
âgulpâ: â^3.5.6â,
âgulp-sassâ: â^2.0.4â,
âgulp-concatâ: â^2.2.0â,
âgulp-minify-cssâ: â^0.3.0â,
âgulp-renameâ: â^1.2.0â
},
âdevDependenciesâ: {
âbowerâ: â^1.3.3â,
âgulp-utilâ: â^2.2.14â,
âshelljsâ: â^0.3.0â,
"@ionic/app-scripts": â0.0.46â
},
âcordovaPluginsâ: [
âcordova-plugin-deviceâ,
âcordova-plugin-consoleâ,
âcordova-plugin-whitelistâ,
âcordova-plugin-splashscreenâ,
âcordova-plugin-statusbarâ,
âionic-plugin-keyboardâ
],
âcordovaPlatformsâ: []
}
I did ânpm installâ and I am doing an âionic serveâ. My AJAX calls are still showing: http://localhost:8100/ so it is not doing the URL proxy. The proxy URL was working fine in an earlier project I did last year. What am I missing?
Hereâs my ionic info:
Your system information:
Cordova CLI: You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.4.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.2
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.46
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS
Node Version: v6.9.1
Thanks.
http://localhost:8100/ is the proxy url so I guess itâs ok that you see that address for your ajax queriesâŚI guess
maybe try to change your proxy config. in my case path value is always the same as the proxy context and path value, like
{
"path": "/test/api",
"proxyUrl": "https://myserver.com/test/api"
}
Hmm I thought the problem was with the proxyUrl not working since I was seeing http://localhost:8100 in my AJAX queries but it turned out I had another problem with my path. It seems to be working now. Thanks for your response reedrichards.
hey, @reedrichards it is not working in real device , working in emulator and browser but itâs not working in real device.
yep, thatâs totally correct, this proxy settings above works only for Ionic >= 2 <= 3 and while debugging ionic serve
thanks @reedrichards , but i am using ionic 3, but itâs not working.
Is there any way to solve this problem.??
probably but unfortunately I donât have a magical out of the box solution
good luck
https://forum.ionicframework.com/t/proxy-settings-not-working/70673/15?u=anujsinghwd
Is there any solution of my above problem @mhartington ?
no⌠it doesnt work⌠the app script is the stable 3.9 version⌠I can get other domain server files but I just query the one I need⌠And I dont know how to handle the server from sharepoint and asp⌠anyone can do a demo??