Welcome! Log In Create A New Profile

Advanced

FastCGI Perl + Nginx

Дмитрий Лялюев
November 30, 2012 06:12AM
Не пойму в чем проблема. Может быть уважаемый All подскажет?

Пытаюсь прикрутить Foswiki к Nginx без индейца:

server {
listen 80;
server_name wiki.localdomain;
root /opt/data/wiki;

error_log /tmp/error.log;
access_log /tmp/access.log;

if ($args ~* "skin|raw|template|maxrev|minrev|currev") {
rewrite ^(.*)$ /bin/view/$1?;
}

rewrite ^/bin/view(.*)$ / redirect;

rewrite ^(/Help)$ /bin/view/Help last;
rewrite ^/(Main|System|Sandbox|Help)(/[A-Z].*)$ /bin/view/$1$2 last;
rewrite ^/([A-Z].*) /bin/view/Help/$1 last;
rewrite ^/(Help)(/[A-Z].*)$ $2;
rewrite ^/([A-Z].*) /bin/view/Help/$1 last;
rewrite ^/$ /bin/view/Help last;

location ~ /bin/view/(System|System/.*|Main|Main/.*|Sandbox|Sandbox/.*) {
auth_basic "Enter your WikiName. (First name and last
name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to register
if you do not have one.";
auth_basic_user_file /opt/data/wiki/data/.htpasswd;
gzip off;
fastcgi_pass unix:/var/run/wiki/fcgi.sock;
fastcgi_split_path_info ^(/bin/\w+)(.*); # Yes, one of the above
links had this wrong
fastcgi_param SCRIPT_FILENAME
/opt/data/wiki/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REMOTE_USER $remote_user;
include fastcgi_params;
}

location / {
limit_except GET POST { deny all; }
}

location ~* /pub/.*\.(s?p?html?|php3?|pl|py|cgi)$ {
types {}
default_type application/octet-stream;
}

location ~ /bin/configure {
allow all; # add allow statements only for administrative IPs!
deny all;
gzip off;
fastcgi_pass unix:/var/run/wiki/configure.sock;
# $socket_path is not in nginx, see number 2 above
fastcgi_split_path_info ^(/bin/configure)(.*); # Yes, one of the
above links had this wrong
fastcgi_param SCRIPT_FILENAME
/opt/data/wiki/bin/configure; # $configure_script is not in nginx, see
number 2 above
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REMOTE_USER $remote_user;
include fastcgi_params;
}

location ~ /bin/.* {
gzip off;
fastcgi_pass unix:/var/run/wiki/fcgi.sock; #
$fcgi_socket comes from #3 above
fastcgi_split_path_info ^(/bin/\w+)(.*); # Yes, one of the above
links had this wrong
fastcgi_param SCRIPT_FILENAME
/opt/data/wiki/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REMOTE_USER $remote_user;
include fastcgi_params;
}

location ~ (^/lib|^/data|^/locale|^/templates|^/tools|^/work) { deny
all; }
}

По вики ходится все замечательно, скрипт конфига вики работает, а вот
http://wiki.localdomain/bin/edit/.... и т.п. не хочет работать.

Ткните носом неразумного плз. :)

--
С уважением,
Дмитрий Лялюев
тел. +380 (66) 532-29-62
Все контакты для связи на http://lyalyuev.info
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

FastCGI Perl + Nginx

Дмитрий Лялюев November 30, 2012 06:12AM

Re: FastCGI Perl + Nginx

skeletor November 30, 2012 09:17AM

Re: FastCGI Perl + Nginx

Dmitriy Lyalyuev November 30, 2012 09:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready