Typecho 1.0 Nginx 提示access denied的解決辦法。
使用Nginx驅動typecho,剛安裝後可以看到首頁卻不能訪問管理登錄或偽靜態頁麵,找了好多方法包括修改:/usr/local/php/etc/php-fpm.conf 在後麵加上一行:security.limit_extensions = .php .asmx .html .js .css .jpg .jpeg .gif .png .htm。可是頁麵還不正常,按照這個blog修改了nginx配置後,問題解決。然後卻發現,輸入用戶名密碼後提示Access denied.提示cgi.fix_pathinfo應該為1,在/etc/php5/fpm/php.ini中修改完畢。最後,重啟php5-fpm和nginx服務,便可以正確登錄管理頁麵。
原文:
Finally fixed it.
The culprit was this line in my config:
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
If I commented this line, everything worked fine. However I saw this in almost every post I read about Nginx configs, so it bothered me. When looking at my configs for the millionth time, I saw that cgi.fix_pathinfo
(in php.ini
) was set to 0, where it should have been 1. The default value PHP uses is also 1, so I must have changed this in my debugging hours, because I remember reading about this value, and thought it was set correct.
Anyway, maybe it helps anyone Googling for this issue.
最後更新:2017-09-23 21:33:01