Fermé

Fix nginx Cors Issue with APP (no app code change)

POST calls are failing with CORS issue.

There is some nginx configuration required to fix the issue.

I already tried below -

if ($request_method ~* "(GET|POST)") {

add_header "Access-Control-Allow-Origin" "*" always;

}

# Preflighted requests

if ($request_method = 'OPTIONS' ) {

add_header 'Access-Control-Allow-Origin' "*" always;

add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';

add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;

add_header 'Access-Control-Max-Age' 1728000;

add_header 'Content-Type' 'text/plain; charset=utf-8';

add_header 'Content-Length' 0;

return 204;

}

Access to XMLHttpRequest at '[login to view URL]' from origin '[login to view URL]' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

vendors~[login to view URL]:1 POST [login to view URL] net::ERR_FAILED

Compétences : Nginx, PHP, Apache, JavaScript, Sécurité Web

en voir plus : develop myspace app sample code, facebook app design code, flex app source code graph, convert windows app web app example code, facebook app bookmark code, iphone xml contacts app source code, facebook app clone code, facebook game app clone code, iphone stock app sample code, shirt design app source code, iphone app source code wave, iphone video recording app source code, play sound iphone app source code, change voice android phone app source code, help fix a simple issue with an existing android app

Concernant l'employeur :
( 2 commentaires ) bangalore, India

Nº du projet : #29453355

4 freelances font une offre moyenne de 1770 ₹ pour ce travail

gattes

Hi there, I have over 10 years of experience with Linux and webservers and I think I can help you with this. Ping me and I will. Cheers mate.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(6 Commentaires)
3.4
ColePLX

Hello, I believe I can help you with this pretty quickly. :) I've been working with webhosting and nginx for the last 12+ years now and at the moment I work for a brazilian cloud hosting startup with thousands of cli Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(4 Commentaires)
2.7
srinivasan257

Hi I’m srinivasan working has an software engineer in Bangalore. I have closely 5 years of experience in IT industries. I’m interested to help you on this issue. Kindly let me know your thoughts. Awaiting for your repl Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
shaffikhan713

Hi we do have the same approach for our applications setup on nginx and I believe that by using the same method that you have applied it should fix the issue. For some minor issue I think it is not working. Let me kno Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 3 jours
(0 Commentaires)
0.0