1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/dokuwiki/nginx.conf

54 lines
1.7 KiB
Nginx Configuration File
Raw Normal View History

2017-03-31 08:32:41 +02:00
user nginx;
worker_processes 4;
pid /run/nginx.pid;
2015-08-24 18:13:01 +02:00
events {
2017-03-31 08:32:41 +02:00
worker_connections 1024;
2015-08-24 18:13:01 +02:00
}
http {
2017-03-31 08:32:41 +02:00
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
2015-08-24 18:13:01 +02:00
server {
2017-03-31 08:32:41 +02:00
listen 80;
server_name _;
client_max_body_size 4M;
2015-08-24 18:13:01 +02:00
client_body_buffer_size 128k;
2017-03-31 08:32:41 +02:00
root /var/www/html;
index doku.php;
location ~ /(data/|conf/|bin/|inc/) {
deny all;
}
2015-08-24 18:13:01 +02:00
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
2017-03-31 08:32:41 +02:00
expires 31536000s;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
log_not_found off;
2015-08-24 18:13:01 +02:00
}
2017-03-31 08:32:41 +02:00
location / {
try_files $uri $uri/ @dokuwiki;
}
2015-08-24 18:13:01 +02:00
location @dokuwiki {
2017-03-31 08:32:41 +02:00
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
2015-08-24 18:13:01 +02:00
}
location ~ \.php$ {
2017-03-31 08:32:41 +02:00
try_files $uri $uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass 127.0.0.1:9000;
2015-08-24 18:13:01 +02:00
}
}
}