Php Nginx+;Zend框架:Htpasswd保护模块
我正在Ubuntu上运行nginx1.1.19。 在我的Zend Framework 1项目中,我想保护一个特定的模块,比如:Php Nginx+;Zend框架:Htpasswd保护模块,php,zend-framework,nginx,Php,Zend Framework,Nginx,我正在Ubuntu上运行nginx1.1.19。 在我的Zend Framework 1项目中,我想保护一个特定的模块,比如: 我不是想劫持你的问题,但是你有没有理由需要使用htpasswd而不是内置的auth/ACL?谢谢你的回答。我们不能使用auth/acl有一些内部原因,这就是我们处理htpasswd的原因。因此,感谢您的回答,但我希望为htpasswd提供一个解决方案。 server { root /srv/www/example/public; index index.php;
我不是想劫持你的问题,但是你有没有理由需要使用htpasswd而不是内置的auth/ACL?谢谢你的回答。我们不能使用auth/acl有一些内部原因,这就是我们处理htpasswd的原因。因此,感谢您的回答,但我希望为htpasswd提供一个解决方案。
server {
root /srv/www/example/public;
index index.php;
...
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
...
}
location ~ ^/protected/.+\.php$ {
auth_basic "restricted";
auth_basic_user_file htpasswd/mypasswd;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}