如何解决nginx 和 php-fpm 返回 302 而不是 200
我的nginx配置是
server{
listen 80;
server_name ~(?<subdomain>[^.]+).mydomain.com
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
if ($subdomain != "dev"){
set $subdomain "main";
}
root /var/www/html/app_$subdomain/public;
index index.php index.html;
underscores_in_headers on;
charset utf-8;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_pass_header device_id;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_read_timeout 120;
proxy_next_upstream error timeout invalid_header http_500;
proxy_connect_timeout 90;
try_files $uri /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php_fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}
我使用 aws 应用程序负载平衡器,它一直返回不健康状态,当我跟踪问题时,它在 php-fpm 端返回 302 而不是 200。
注意我在这个过程中使用了docker
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。