Welcome! Log In Create A New Profile

Advanced

Re: FreeBSD & nginx

November 23, 2010 10:27AM
Скажем так я и есть тот Админ, но начинающий, я только учусь.

А всем тем кто откликнулся в этой теме, безмерное спасибо и да прибудет с Вами сила.


Сайт завелся, нашел ошибку, я не юзаю fastcgi, а использую php-fpm.
Но теперь другая беда, если заходить на сайт fun.viks.net.ua/ и не добавлять index.php то будет ошибка 500, а если же добавить index.php то откроется главня страница сайта. Конфиг сайта стянул с drupal.ru, но что-то он не хочет работать...


Конфиг сайта:

[code] server {
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 @cache;
}

location @cache {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}

if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}

error_page 405 = @drupal;

add_header Expires epoch;
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
try_files /cache/normal/$host${uri}_$args.html @drupal;
}

location @www {
###
### 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 @www; #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 = @uncached;
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 = @uncached;
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 = @uncached;
access_log off;
expires max; #if using aggregator
try_files /cache/normal/$host${uri}_.json $uri =404;
}

location @uncached {
access_log off;
expires max; # max if using aggregator, otherwise sane expire time
}

location ~* /files/imagecache/ {
access_log off;
try_files $uri @drupal; #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 = @drupal;
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 @drupal;
}

location ~* /feed$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}

error_page 405 = @drupal;
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 @drupal;
}

} # end of server


[/code]
Subject Author Posted

FreeBSD & nginx

KaMaToZzz November 23, 2010 07:20AM

Re: FreeBSD & nginx

Alexander Petrovsky November 23, 2010 07:28AM

Re: FreeBSD & nginx

Sergey Shepelev November 23, 2010 07:30AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 07:39AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 07:58AM

Re: FreeBSD & nginx

Дмитрий Андреев November 23, 2010 07:46AM

Re: FreeBSD & nginx

Sergey Shepelev November 23, 2010 07:46AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 08:31AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 08:48AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 08:58AM

Re: FreeBSD & nginx

Anton Yuzhaninov November 23, 2010 08:38AM

Re: FreeBSD & nginx

Sergey Shepelev November 23, 2010 08:38AM

Re: FreeBSD & nginx

DeD MustDIE November 23, 2010 09:08AM

Re: FreeBSD & nginx

Anton Gorlov November 23, 2010 09:32AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 09:48AM

Re: FreeBSD & nginx

Sergey Averyanov November 23, 2010 09:54AM

Re: FreeBSD & nginx

Sergey Shepelev November 23, 2010 10:08AM

Re: FreeBSD & nginx

KaMaToZzz November 23, 2010 10:27AM

Re: FreeBSD & nginx

Валентин Бартенев November 23, 2010 11:08AM

Re: FreeBSD & nginx

KaMaToZzz November 25, 2010 02:21AM

Re: FreeBSD & nginx

xpahos@gmail.com November 25, 2010 04:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready