No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    proxyTable doesnt change my Origin Header and CORS erros occur

    Help
    2
    3
    1045
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      peterPanParker last edited by peterPanParker

      this is my configuration:

      proxyTable: {
      ‘/’: {
      target: ‘http://localhost/isaac/’,
      changeOrigin: true,
      secure: false,
      headers: {
      Origin: ‘http://localhost/isaac/’
      }
      /* cookieDomainRewrite: ‘http://localhost/isaac/’,
      onProxyReq: function (request, req, res) {
      request.setHeader(‘origin’, ‘http://localhost/isaac/’)
      }
      */
      }
      }

      i see in the console requested url is the correct but apache server return a cors error and the requested header shows me:

      Origin http://localhost:8081

      which should be http://localhost:80/ to avoid cors errors i suppouse
      i have no more ideas of how figure it out, please help me
      thanks

      PD im using codeigniter framework

      1 Reply Last reply Reply Quote 0
      • benoitranque
        benoitranque last edited by

        try setting 'Access-Control-Allow-Origin': 'http://localhost:8081' in your backend on every response

        1 Reply Last reply Reply Quote 0
        • P
          peterPanParker last edited by peterPanParker

          thanks, but i did not want to use ‘Access-Control-Allow-Origin’: ‘http://localhost:8081’ in my backend, thats why i tried to use a proxy…

          And i resolved with this config:

          proxyTable: {
          ‘/index.php/**’: {
          target: ‘http://localhost:80/isaac/’,
          ‘changeOrigin’: true,
          secure: false,
          logLevel: ‘debug’,
          headers: {
          ‘Origin’: ‘http://localhost:80’
          }
          }
          }

          It seems my attemps to get it run failed because of the route ‘/’ instead of ‘index.php/**’
          thanks again, now it is working fine

          1 Reply Last reply Reply Quote 1
          • First post
            Last post