skip to Main Content

I am facing a problem in moodle mobile app
I downloaded the mobile app from google play and apple store

when I try to write the link for my moodle website I get the error message

enter image description here

the mobile app can connect on the instance on staging environment which is Apache on xampp

but when I connect it to production it failed and give me the error in the screenshot

I have searched a lot and tried the following solutions

  • I have tried to open the website on the browser on mobile and it works
  • I have also tried to update OS of the production server and to update curl PHP and still does not work

The production infrastructure is built one Nginx proxy that takes the request and then redirects it to the apache server of moodle

also, the warning on moodle website says that the SSL certificate is SHA1 and should be SHA265 and this is incorrect, I checked the certificate on SSL checker websites and it has no problem

so could you please advise what should I do?

3

Answers


  1. Chosen as BEST ANSWER

    The problem was in Nginx configuration it has a duplicate rule for

    add_header Access-Control-Allow-Origin *;
    

    when I removed it from the configuration file, it works normally


  2. On the production Moodle site, are the mobile app web services enabled?

    These will need to be enabled in order for the Moodle app to talk to the server.

    Login or Signup to reply.
  3. You have to create .htaccess file in your Moodle root directory.

    The below code should be there in the .htaccess file.

    Header set Access-Control-Allow-Origin “*”

    For more details, you can see my youtube video:-
    https://www.youtube.com/watch?v=oT6NkUMN32E&t=12s

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search