0

I have developed an api in laravel and then there is no ssl certificate installed and all working good. But after some time, I have install ssl certificate but now the api's not working in my mobile app but it's working in postman.

the response getting from you have not passed any header but in actual I have passed header. I have just made one changes http->> https in url.

bhucho
  • 3,903
  • 3
  • 16
  • 34

1 Answers1

0

You would need to update the code in your mobile app to point to https, instead of http.

If you are hosting your API with Nginx, you can redirect HTTP -> HTTPS requests by modifying your config such as:

server {
    listen 80 default_server;

    server_name _;

    return 301 https://$host$request_uri;
}

This will automatically redirect any HTTP request to its SSL equivalent.

Cyril Graze
  • 3,881
  • 2
  • 21
  • 27
  • which config file will you please tell me because i have did it but i'm able to. – Jaltesh Ghevariya Aug 23 '20 at 05:33
  • First question before even trying this ^, is if you are even using Nginx? If you are not using Nginx, then it does not apply, and you would need to tell us what webserver you are using. If you are indeed using Nginx, then you will find the configuration files for your active hosts at: /etc/nginx/sites-enabled/*.conf – Cyril Graze Aug 23 '20 at 23:53