Answer the question
In order to leave comments, you need to log in
Help translate apache config to nginx for PHPRedMin
I can't fully understand nginx. There is a PHP client for Redis ,
And here is the config for Apache
# phpredmin - Simple web interface to manage and monitor your Redis
#
# Allows only localhost by default
Alias /phpredmin /var/www/phpredmin/public
<Directory /var/www/phpredmin/>
AllowOverride All
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip localhost
Require local
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
server {
listen 80;
set $bootstrap "index.php";
server_name redis.dev;
root /var/www/redis/public;
index $bootstrap;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# позволяем перехватывать запросы к несуществующим PHP-файлам
set $fsn /$bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
# PATH_INFO и PATH_TRANSLATED могут быть опущены, но стандарт RFC 3875 определяет для CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
}
2013/11/06 12:18:20 [error] 5728#0: *8 open() "/var/www/redis/public/index.php/welcome/index/1" failed (20: Not a directory) , client: 192.168.237.1, server: redis.dev, request: "GET /index.php/welcome/index/1 HTTP/1.1", host: "redis.dev", referrer: " redis.dev/ "
Answer the question
In order to leave comments, you need to log in
He asked, he answered. added to config
location ~ \.(js|css|png|jpg|gif|bmp|swf|ico|pdf|mov|fla|mp4|3gp|zip|rar|7z)$ {
try_files $uri = 404;
access_log off;
expires 24h;
}
location / {
rewrite .* /index.php;
index index.html $bootstrap;
try_files $uri $uri/ /$bootstrap?$args;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question