错误:从上游读取响应标头时,stderr主脚本中发送的FastCGI未知

时间:2020-02-19 11:08:56

标签: nginx push-notification nginx-location safari-push-notifications

我正在尝试进行网络推送。当我单击订阅按钮时,应该请求beta.push.xy.com/onur/v1/pushPackages/web.com.beta.push.setrowid.setrowNotifications(如果我正确理解了文档:D),但是当我查看nginx错误日志时

FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.132.1, server: beta.push.xy.com, request: "POST /onur/v1/pushPackages/web.com.beta.push.xy.setrowNotifications HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "beta.push.xy.com"

我的配置在/ etc / nginx / sites-enabled

server {

        root /var/www/beta;
        index index.php index.html index.htm;
        server_name beta.push.xy.com;

        location @extensionless-php {
                rewrite ^(.*)$ $1.php last;
        }

        location / {
                try_files $uri $uri/ @extensionless-php;
                add_header X-HTTPS https;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}
server {
        listen 443;
        server_name beta.push.xy.com;

        root /var/www/beta;
        index index.php index.html index.htm;

        ssl on;
        ssl_certificate /etc/nginx/ssl/beta.push.xy.com/fullchain.pem;
        ssl_certificate_key /etc/nginx/ssl/beta.push.xy.com/privkey.pem;

        ssl_session_timeout 5m;

        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;

        location @extensionless-php {
                rewrite ^(.*)$ $1.php last;
        }

        location / {
                try_files $uri $uri/ @extensionless-php;
                add_header X-HTTPS https;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
         fastcgi_index index.php;
                include fastcgi_params;
       }

#Safari Push Package Request
location /onur/v1/pushPackages/web.com.beta.push.xy.setrowNotifications {
      add_header "Access-Control-Allow-Origin"  *;
      allow all;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME /var/www/beta/onur/index.php;
}

}

如何解决此错误?

0 个答案:

没有答案