0
我设置了2个服务器,一个服务器是nginx,端口80。 B服务器是PHP与Apache,端口80。如果我访问B:80/index.php,它可以正常工作。nginx将php请求传递给一个php-apache服务器,但下载而不是执行php文件
在服务器A上,Nginx的CONF:
location ~ .*\.php$ {
#fastcgi_pass B:80;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;
# include fastcgi_params;
proxy_pass http://B:80;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
是的,我知道的FastCGI,但我只是想试试这样一来,当我访问答:80/index.php文件,它下载PHP文件而不是执行它,这是什么问题?