Github에 멋진 PHP/MySQL 로그인 시스템이 있습니다. 제대로 작동하게하려면 .htaccess 파일이 필요합니다. 훌륭합니다. 것은,하지만, 나는 아파치가 아니라 nginx를 사용합니다. 이 재 작성 규칙을 nginx로 어떻게 변환 할 수 있습니까?세 개의 아파치 "RewriteCond"규칙을 nginx로 변환
# Necessary to prevent problems when using a controller named "index" and having a root index.php
# more here: http://stackoverflow.com/q/20918746/1114320
Options -MultiViews
# turn rewriting on
RewriteEngine On
# When using the script within a sub-folder, put this path here, like /mysubfolder/
# If your app is in the root of your web folder, then please delete this line or comment it out
RewriteBase /php-login/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
이 내가 apache-to-nginx rules converter 웹 사이트에서 자동으로 생성, 뭘하려 :
location /php-login/ {
if (!-e $request_filename){
rewrite ^/php-login/(.+)$ /php-login/index.php?url=$1 break;
}
}
파일 (index.php를 같은) 대신 열리지의 다운로드되고 있었다. 필자는 다시 쓰기 규칙이 끝날 때 "중단"을 제거했습니다. 그것은 효과가 있었다. 그러나 이것이 올바른지 또는이 아파치 규칙을 nginx로 변환하는 더 좋은 방법이 있는지 알고 싶습니다.
이 문제 https://stackoverflow.com/questions/44346456/apache-auth-rules-converted-for-nginx-server –