2024-01-20 17:38:41 +00:00
|
|
|
server {
|
2024-10-22 08:16:22 +00:00
|
|
|
listen 443 ssl;
|
|
|
|
listen [::]:443 ssl;
|
2024-06-19 11:14:51 +00:00
|
|
|
server_name {{ dns_name }};
|
2024-01-20 17:38:41 +00:00
|
|
|
|
2024-10-22 08:16:22 +00:00
|
|
|
http2 on;
|
2024-06-19 11:14:51 +00:00
|
|
|
ssl_certificate /etc/letsencrypt/live/{{ dns_name }}/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/{{ dns_name }}/privkey.pem;
|
2024-01-20 17:38:41 +00:00
|
|
|
|
|
|
|
client_max_body_size 100M;
|
|
|
|
|
2024-05-28 11:34:34 +00:00
|
|
|
root /srv/http/dokuwiki;
|
2024-01-20 17:38:41 +00:00
|
|
|
index index.php;
|
|
|
|
|
|
|
|
location ~ /(conf/|bin/|inc/|vendor/|install.php) { deny all; }
|
|
|
|
location ~ ^/data/ { internal; }
|
|
|
|
location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$ { expires 365d; }
|
|
|
|
|
|
|
|
location / { try_files $uri $uri/ @dokuwiki; }
|
|
|
|
|
|
|
|
location @dokuwiki {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ \.php$ {
|
|
|
|
try_files $uri $uri/ /doku.php;
|
|
|
|
|
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
fastcgi_param REDIRECT_STATUS 200;
|
|
|
|
fastcgi_param HTTPS on;
|
|
|
|
fastcgi_pass unix:/run/php-fpm.socket;
|
|
|
|
}
|
|
|
|
}
|