302 리디렉션 .php 나는 $ _SERVER [ 'REQUEST_URI']를 사용하여 사용자가보고 싶은 페이지 (예 : /testfile.php)를 확인하므로 index.php가 적절한 html 코드를 생성 할 수 있습니다. testfile.php가 존재할 필요는 없다.nginx를 대신 재 (200)
제 문제는 testfile.php을 요청하려고 할 때 항상 리디렉션 302가 발생한다는 것입니다. 결과적으로 $ _SERVER [ 'REQUEST_URI']는 /입니다. 하지만 내가 원하는 것은 testfile.php에 대해 200 OK이고 index.php는 이에 대한 올바른 html 코드를 생성합니다.
server {
[...]
root /home/test;
# When I go to mysite.com redirect my to mysite.com/
location =/{
index index.php;
}
# For any php file request: let index.php handle the request
location ~ \.(php)$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /home/test/index.php;
}
}
누구든지 나를 도울 수 있습니다
이 내 버그 nginx.conf에서 조각은 무엇입니까? 감사합니다. .