场景2: angular http 访问后台php文件 出现 404 原因: nginx配置解析php出现问题 一般是如:
location ~ \.php$ { root **D:/article-system/backend**; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME **D:/article-system/backend**$fastcgi_script_name; include fastcgi_params; }root目录配置错误,导致服务器无法找到请求的php文件 ,注意在前端代码http请求的api路径要以 php 所在目录 root为 初始路径。 解决方法:root 和 fastcgi_param 下 加粗的地方 要配置正确
405 not allowed 原因:nginx 不允许post访问静态资源 解决办法:静态server下的location加入error_page 405 =200 $uri; 参考博文