Skip to content
Discussion options

You must be logged in to vote

Figured it out with the help of colleagues . Running it in Kubernetes, I translated it back to nginx config:

location / {
    if ($request_method = 'OPTIONS') {
        add_header 'Content-Type' 'text/plain charset=UTF-8';
        add_header 'Content-Length' 0;
        return 204;
    }

    proxy_buffering off;
    proxy_http_version 1.1;
    proxy_max_temp_file_size 0;

    # Cors Preflight methods needs additional options and different Return Code
    chunked_transfer_encoding on;
    add_header 'Access-Control-Allow-Origin' $http_origin;
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS';
   …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cohen1280
Comment options

@yusofy
Comment options

Answer selected by cohen1280
@asrorbekh
Comment options

@dellvolk
Comment options

@bertiejohnson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage
5 participants