내 nginx 서버에서 하위 디렉토리를 사용하는 데 문제가 있습니다.루트에서 WordPress의 nginx php와 서브 디렉토리의 다른 앱
나는 웹 루트로 WordPress 설치를 제공하고 서브 디렉토리에서 추가 PHP 응용 프로그램을 실행하려고 nginx를 사용하고 있습니다. Wordpress 잘 실행되지만 404, 403, 또는 "지정된 입력 파일 없음."않고 하위 디렉터리에서 실행되도록 응용 프로그램을 얻을 수 없습니다. 다양한 구성의 오류. 확실한 것이 있지만, 알아낼 수는 없습니다! 어떤 도움을 크게 감상 할 수
:
여기에 관련 설정입니다!
server {
listen myserver.edu:8081;
server_name myserver.edu:8081;
try_files $uri $uri/ /index.php;
location/{
root /path/to/nginx/html/wordpress;
index index.php;
}
location /stacks {
alias /another/path/to/usr/local/share/stacks/php;
index index.php;
}
location ~ \.php$ {
set $php_root /path/to/nginx/html/wordpress;
include fastcgi_params;
fastcgi_pass localhost:8082;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
}
location ~ \stacks.php$ {
set $php_root /another/path/to/usr/local/share/stacks/php;
include fastcgi_params;
fastcgi_pass localhost:8082;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
}
굉장! 그게 전부! 훨씬 더 간단합니다. 이 방법으로 보안 문제가 있습니까? – jasongallant
Wordpress 설치가 해킹 당하면 다른 웹 사이트에도 액세스 할 수 있으며 반대의 경우도 마찬가지입니다. 그러나 해킹 당하면 어쨌든 망해진다. 왜 이것이 이것이 이전의 시도보다 더 안전하지 않은지 나는 알지 못할 것입니다. – Zombaya
멋진데, 고마워. 나는 이전이 특히 안전하다고 생각하지는 않았지만 나는 이것에 대해 처음이야. 그래서 나는 물을 것이라고 생각했다. – jasongallant