Fiorri2015-11-18 15:35:27
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;
    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_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