Nginx가 심볼릭 링크를 따르도록 다음 링크가 있습니다. lrwxrwxrwx

Nginx는 기호 링크를 따르지 않습니다. 404 오류가 발생합니다. 내 디렉토리에는 다음 링크가 있습니다.

lrwxrwxrwx  1 root root    48 Sep 23 08:52 modules -> /path/to/dir/

그러나 저장된 파일을 /path/to/dir찾을 수 없습니다.



답변

disable_symlinks off;내 nginx.conf에 삽입하면 문제가 해결됩니다.

http {
    disable_symlinks off;
}

답변

이 게시물 에서 해결책을 찾았 습니다 .

보다 구체적으로,이 라인들은 :

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

답변

폴더를 마운트하여 ‘바인드’옵션 사용 =)

sudo nano /etc/fstab

유형:

/path/where/my/big/files_dir /var/www/myhost/media_dir bind defaults,bind 0 0

(심볼릭 링크가 없으며 & vds / cpu를 다시 시작하는 것을 잊지 마십시오)