F
F
Fiorri2015-11-18 15:35:27
JavaScript
Fiorri, 2015-11-18 15:35:27

Ajax request using the options method in the Firefox browser gives a 502 error, how to fix it?

there is a main domain https://domen.com

The main domain works with api https://api.domen.com ajax cors. At the same time, everything is fine in all browsers, but in firefox, when requested by the OPTIONS method, we get 502 Bad Gateway. If you work without https, then everything is fine.

nginx config file

server {
    listen 443 ssl spdy;
    server_name api.domen.com;
    
    resolver 8.8.8.8;
    ssl_stapling on;
    ssl on;
    ssl_certificate /root/serts/domen.crt;
    ssl_certificate_key /root/serts/domen.key;
    ssl_dhparam /root/serts/domen.pem;
    ssl_session_timeout 10m;
    ssl_session_cache shared:SSL:20m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security "max-age=31536000;";
    add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /$
  
    include hhvm.conf;
    root /var/www/domen.com/www/api/;
    index index.php;
    charset utf-8;

    access_log /var/www/domen.com/logs/api-access.log;
    error_log /var/www/domen.com/logs/api-errors.log;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ /\.ht {
        deny all;
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question