2016-10-13 23:04:44 +00:00
|
|
|
worker_processes 4;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 768;
|
|
|
|
# multi_accept on;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
# Basic Settings
|
|
|
|
sendfile on;
|
|
|
|
tcp_nopush on;
|
|
|
|
tcp_nodelay on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
types_hash_max_size 2048;
|
|
|
|
# server_names_hash_bucket_size 64;
|
|
|
|
server_tokens off;
|
|
|
|
server_name_in_redirect off;
|
|
|
|
|
|
|
|
include mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
error_log stderr;
|
|
|
|
|
|
|
|
# Prevent nginx from adding compression; this interacts badly with Sandstorm
|
|
|
|
# WebSession due to https://github.com/sandstorm-io/sandstorm/issues/289
|
|
|
|
gzip off;
|
|
|
|
|
|
|
|
# Trust the sandstorm-http-bridge's X-Forwarded-Proto.
|
|
|
|
map $http_x_forwarded_proto $fe_https {
|
|
|
|
default "";
|
|
|
|
https on;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 8000 default_server;
|
|
|
|
listen [::]:8000 default_server ipv6only=on;
|
|
|
|
|
2020-06-13 21:49:54 +00:00
|
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
|
2016-10-13 23:04:44 +00:00
|
|
|
# Allow arbitrarily large bodies - Sandstorm can handle them, and requests
|
|
|
|
# are authenticated already, so there's no reason for apps to add additional
|
|
|
|
# limits by default.
|
|
|
|
client_max_body_size 0;
|
|
|
|
|
|
|
|
server_name localhost;
|
|
|
|
root /opt/app/dokuwiki;
|
|
|
|
index doku.php;
|
|
|
|
|
2020-06-13 21:49:54 +00:00
|
|
|
error_page 500 ../500.html;
|
|
|
|
|
2016-10-13 23:04:44 +00:00
|
|
|
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
|
|
|
|
|
|
|
|
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$ {
|
|
|
|
if (!-f $request_filename) { return 404; }
|
|
|
|
include fastcgi_params;
|
2020-06-03 14:32:15 +00:00
|
|
|
fastcgi_pass unix:/var/run/php-fpm7.0.sock;
|
2016-10-13 23:04:44 +00:00
|
|
|
fastcgi_param REDIRECT_STATUS 200;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
2020-06-13 21:49:54 +00:00
|
|
|
fastcgi_intercept_errors on;
|
2016-10-13 23:04:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|