[Comm] wiki & nginx
REAL
real на kemsu.ru
Вт Сен 3 07:20:07 MSK 2013
03.09.2013 09:58, REAL пишет:
>>>>> http://wiki.nginx.org/**MediaWiki
>>>>> <http://wiki.nginx.org/MediaWiki>
>
> Вопрос, в какой файл эти настройки пихать.
И ещё. Сервер задействован, location / вполне работоспособен. Мне бы
настроить, чтобы вики отзывалось на /wiki, но что-то не выходит. См.
конфиг /etc/nginx/sites-available.d/default.conf
вдруг я где-то протупил (на любое обращение получаю - 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/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;
}
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/wiki/local;
autoindex on;
}
}
--
REAL aka Евгений Ростовцев, программист ЦНИТ КемГУ
Подробная информация о списке рассылки community