CI4.0.3 Error CORS ON GET - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9) +--- Thread: CI4.0.3 Error CORS ON GET (/showthread.php?tid=76590) |
CI4.0.3 Error CORS ON GET - erick.costa - 05-29-2020 I am using REST API but much problems with CORS in apache + ubuntu 16.0.4. I have errors CORS when my application (AngularJS) try to do the GET and don't have the '?' on end of URL. Example: GET api.xxx:8080/controller?/ Anybody have solution to this? My APP.php public $uriProtocol = 'REQUEST_URI'; public $indexPage = ''; My .htaccess Code: # Disable directory browsing RE: CI4.0.3 Error CORS ON GET - bhaumikkothari - 05-29-2020 We were having similar issue while using Nuxt(VueJs) framework. Apparently it was resolved by doing proxy config in the Nuxt app itself. So probably you need to similarly apply proxy config for calling cross domain apis from your Angular app, nothing much is required on CI end I guess. RE: CI4.0.3 Error CORS ON GET - erick.costa - 06-03-2020 I need create one proxy? Or only change any config in CI. I am developer and never config one proxy. RE: CI4.0.3 Error CORS ON GET - 2k10cs86 - 09-07-2021 Hello, I have followed what you have mentioned that this CORS issue is resolved by angular proxy, I have created a simple proxy and giving me the below error: Code: [HPM] Error occurred while trying to proxy request /api/v1/login from localhost:4200 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) In browser console: Code: Backend returned code 504, body was: Error occured while trying to proxy to: localhost:4200/api/v1/login Where Code: ECONNREFUSED (Connection refused): No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host. And here is the proxy: Code: { Any idea whats wrong with that? |