Проблема с друпалом, при переходе на http://fun.viks.net.ua/admin/settings/cf_webchat (к примеру), протсо белый лист, жму обновить страницу, страница загружается норм, короче с первого раза, не срабатывает.
Как быть, кто подскажет?
конфиг nginx:
location / {
root /www/;
index index.php index.html index.htm;
if (!-e $request_filename ) {
rewrite ^(.*)$ /index.php?q=$1;
}
}
# php
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/$fastcgi_script_name;
include fastcgi_params;
}
Комментарии
https://github.com/yhager/nginx_drupal
http://www.ruby-forum.com/topic/181640
последняя ссылка, можно заменять nginx.conf без проблем?
А что если у меня на freebsd, в /usr/local/etc/nginx нету папок sites-available и sites-default?
Последний это рабочий пример. Копипаст не приветствуется. Лучше изучить директивы. Читайте доки по энжи они же на русском.
Что такое энжи?
nginx - Engine X
подскажите пожалуйста, где ошибка?
так как заходя на сайт без добавления index.php белый лист, а если с index.php то открывается главня страница.
Конфиги выше не помогли, вот мои конфиги:
listen 80;
server_name fun.viks.net.ua;
access_log /var/log/nginx/example.access_log main;
error_log /var/log/nginx/example.error_log info;
root /www;
## www. redirect
if ($host ~* ^(www\.)(.+)) {
set $rawdomain $2;
rewrite ^/(.*)$ http://$rawdomain/$1 permanent;
}
## 6.x starts
location / {
#rewrite ^/(.*)/$ /$1 permanent; # remove trailing slashes - disabled
try_files $uri [user=cache]cache[/user];
}
location [user=cache]cache[/user] {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=drupal]drupal[/user];
add_header Expires epoch;
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
try_files /cache/normal/$host${uri}_$args.html [user=drupal]drupal[/user];
}
location [user=www]www[/user] {
###
### now simplified to reduce rewrites
###
rewrite ^/(.*)$ /index.php?q=$1 last;
}
location ~* (/\..*|settings\.php$|\.(htaccess|engine|inc|info|ini|install|module|profile|pl|po|pot|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(Entries.*|Repository|Root|Tag|Template))$ {
deny all;
}
location ~* /files/.*\.php$ {
return 444;
}
location ~* /themes/.*\.php$ {
return 444;
}
location ~* \.php$ {
try_files $uri [user=www]www[/user]; #check for existence of php file
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.css$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=uncached]uncached[/user];
access_log off;
expires max; #if using aggregator
try_files /cache/perm/$host${uri}_.css $uri =404;
}
location ~ \.js$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=uncached]uncached[/user];
access_log off;
expires max; #if using aggregator
try_files /cache/perm/$host${uri}_.js $uri =404;
}
location ~ \.json$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=uncached]uncached[/user];
access_log off;
expires max; #if using aggregator
try_files /cache/normal/$host${uri}_.json $uri =404;
}
location [user=uncached]uncached[/user] {
access_log off;
expires max; # max if using aggregator, otherwise sane expire time
}
location ~* /files/imagecache/ {
access_log off;
try_files $uri [user=drupal]drupal[/user]; #imagecache support - now it works
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
access_log off;
expires 30d;
try_files $uri =404;
}
location ~* \.xml$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=drupal]drupal[/user];
add_header Expires epoch;
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
types { }
default_type application/rss+xml;
try_files /cache/normal/$host${uri}_.xml /cache/normal/$host${uri}_.html $uri [user=drupal]drupal[/user];
}
location ~* /feed$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = [user=drupal]drupal[/user];
add_header Expires epoch;
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
types { }
default_type application/rss+xml;
try_files /cache/normal/$host${uri}_.xml /cache/normal/$host${uri}_.html $uri [user=drupal]drupal[/user];
}
} # end of server
сорри, я не ниньзя в конфиге энжи, а времени на разбор нет совсем.
возьмите отсюда конфиг, он рабочий http://drupal.ru/node/31807
от туда и брал вот этот http://drupal.ru/files/nginx.tgz
чуток подправил, но не хочет страницы грузить без index.php
взял конфиг drupal.ru
все равно если вводить логин при входе, первый раз после нажатия на кнопку будет белая страница, нажимаешь f5 и все приходит в норму...
Блин ну ничего не выходит, я даже статью не могу удалить, белый лист, обновляю страницу, статья по прежнему есть.... Ну кто нибудь помогите!!!
Вопрос такой, а если выключены ссылки как уазаны тут /index.php?q=$1 , а включены типо /chat/ /news/ должен ли быть вот такой конфиг или строка rewrite будет иметь другое значение?
root /path/to/drupal;
index index.php index.html;
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
if (!-d $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
}
получилось вылечить удалив модуль PMLite
со временем появилась другая беда.
по любым ссылкам ходить можно, а вот по /admin пишет что болт 404 - not found
а вот на /chat или /webcams спокойно заходит...
Что это такое может быть?