0

the API endpoints are working in localhost but at the moment I'm deploying it to the server, and some of the endpoints are not working.

http://localhost:xxxx/api/endpoint ==> working

https://myapiurl.com/api/endpoint ==> not working

Here is my Nginx configuration :

root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name golivegameplan.com www.golivegameplan.com https://golivegameplan.com;

        location / {
                proxy_pass http://localhost:5000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                #try_files $uri $uri/ =404;
        }



    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/golivegameplan.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/golivegameplan.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

Is there anything I'm missing?

2 Answers 2

1

You might want to check if you're getting a CORS error. Is it functioning in postman?

Sign up to request clarification or add additional context in comments.

2 Comments

No, it functioning in postman in postman, I have updated the SSL. It's not the CORS error I guess, as 70% of the API is working, newly deployed once are not working
This reads more like a comment than an answer to me. One of the primary purposes of the question's comment section is to ask for clarification or more details from the asker.
0

Have you tried using 0.0.0.0 in the proxy_pass directive instead of localhost?

2 Comments

No, I did not. I'll try once!
Did this help? Could you figure it out?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.