[Comm] wiki & nginx

Дмитрий Кулик lnkvisitor.ts на gmail.com
Вт Сен 3 12:59:31 MSK 2013


2013/9/3 REAL <real на kemsu.ru>

> Продолжаем ковырять. Переделал конфиг (см. в конце). Но на каждое
> обращение к wiki получаю "502 Bad Gateway". Что я упустил?
>
>
>
> server {
>         listen  *:8080;
> # can't use wildcards in first server_name
>         server_name localhost localhost.localdomain;
>         root /opt/tomcat/static;
>
>         location / {
>
>         # autoindex off;
>         # autoindex_exact_size on;
>         # autoindex_localtime off;
>
>         # expires off;
>
>         # cooperate with mod_realip in apache-1.3 or mod_rpaf in apache-2.x
>         #       proxy_redirect off;
>         #       proxy_set_header Host $host;
>         #       proxy_set_header X-Real-IP $remote_addr;
>         #       proxy_set_header X-Forwarded-For $remote_addr;
>         #       proxy_pass http://back.end.addr.ess:80/;
>         #
>         # NB: it's better for URI canonicalization that apache sits on :80
>         # (even if that's only 127.0.0.1:80)
>         #
>         # see also set_real_ip_from, real_ip_header if this nginx
>         # would need to cooperate with another one acting as a frontend
>         }
>
> # Pass PHP scripts to PHP5-FPM
>
> #       location ~* \.php$ {
> #           fastcgi_index   index.php;
> #           fastcgi_pass   unix:/var/run/php5-fpm/php5-**fpm.sock;
> #           include         fastcgi_params;
> #           fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_
> **name;
> #           fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
> #       }
>
>                 access_log  /var/log/nginx/access.log;
> }
>
> server {
>                                 listen  *:8080;
>         server_name iais.kemsu.ru;
>         root /opt/tomcat/static/wiki;
>
>
>         client_max_body_size 5m;
>         client_body_timeout 60;
>
>         location / {
>                 try_files $uri $uri/ @rewrite;
>         }
>
>         location @rewrite {
>                 rewrite ^/(.*)$ /index.php?title=$1&$args;
>         }
>
>         location ^~ /maintenance/ {
>                 return 403;
>         }
>
>         location ~ \.php$ {
>                 include fastcgi_params;
>                 fastcgi_pass unix:/tmp/phpfpm.sock;
>
Для начала убедитесь что php5-fpm настроен на этот путь и запущен.
Стандартный путь unix:/var/run/php5-fpm/php5-fpm.sock;

>         }
>
>         location ~* \.(js|css|png|jpg|jpeg|gif|**ico)$ {
>                 try_files $uri /index.php;
>                 expires max;
>                 log_not_found off;
>         }
>
>         location = /_.gif {
>                 expires max;
>                 empty_gif;
>         }
>
>         location ^~ /cache/ {
>                 deny all;
>         }
>
>         location /dumps {
>                 root /opt/tomcat/static/wiki/local;
>                 autoindex on;
>
>         }
> }
>

-- 
Dmitry Kulik
ALTLinux Team
e-mail: lnkvisitor.ts[at]gmail.com
jabber: lnkvisitor.ts[at]gmail.com
----------- следующая часть -----------
Вложение в формате HTML было удалено...
URL: <http://lists.altlinux.org/pipermail/community/attachments/20130903/aa84e72a/attachment.html>


Подробная информация о списке рассылки community