我在nginx虚拟主机文件中设置了fastcgi_param ENVIRONMENT
,但我无法在CodeIgniter中访问该值:
var_dump(defined('ENVIRONMENT')); //outputs false
完整的nginx虚拟主机文件:
server {
listen 80;
# Hostnames alias
server_name webapp1;
root /home/edson/repositorios/webapp1;
index index.php index.html;
location /bec/admin {
try_files $uri $uri/ /bec/admin/index.php$is_args$args;
}
location /bec {
try_files $uri $uri/ /bec/index.php$is_args$args;
}
#
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include /etc/nginx/php.conf;
fastcgi_param ENVIRONMENT development;
}
# Nginx Cache Control for Static Files (Browser Cache Control Directives)
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml|xls|xlsx|doc|docx|csv|txt)$ {
access_log off;
log_not_found off;
expires max;
}
#
# deny access to .htaccess files, and hidden files, which starts with dot (.), if Apache's document root
# concurs with nginx's one
#
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
}
我做错了吗?