diff options
Diffstat (limited to 'etc/nginx/wiki.conf.sample')
-rwxr-xr-x | etc/nginx/wiki.conf.sample | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/etc/nginx/wiki.conf.sample b/etc/nginx/wiki.conf.sample new file mode 100755 index 00000000..fbb036fa --- /dev/null +++ b/etc/nginx/wiki.conf.sample @@ -0,0 +1,74 @@ +# ---- +# Copyright (C) 2013-2020 - Reevo (http://reevo.org) +# License: Affero GPL version 3 - http://www.gnu.org/licenses/agpl.html +# ES: Este archivos es parte de: reevo-web (http://git.reevo.org/reevo/reevo-2020) +# EN: This file is part of: reevo-2020 (http://git.reevo.org/reevo/reevo-2020) +# ---- + +server { + server_name wiki.example.org; + root /srv/reevo-2020/www/wiki; + + index index.php; + + access_log /srv/reevo-2020/log/wiki/nginx.access.log; + error_log /srv/reevo-2020/log/wiki/nginx.error.log; + + if ($request_method !~ ^(GET|HEAD|POST)$) { + return 405; + } + + # Force static locations + location = /favicon.ico { + expires +1y; + } + + # Forbid access to files starting with . + location ~ /\. { + access_log off; + log_not_found off; + deny all; + } + + # Prevent access to internal URIs + location ^~ /(bin|docs|extensions|includes|maintenance|resources|serialized|tests)/ { + internal; + } + + ## Uncomment after install + # location ^~ /mw-config/ { internal; } + + # Prevent non-images in /images + location ~* /images/.*\.[^\\/:*?\x22<>|%]+(#|\?|$) { + types { } + default_type text/plain; + } + + location / { + # Sitio offline + if ($maintenance) { return 503; } + + # Bloquea bots + if ($limit_bots) { add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; } + + try_files $uri $uri/ =404; + error_page 404 = @mediawiki; + error_page 503 = @maintenance; + } + + location @maintenance { + # Sitio offline + rewrite ^(.*)$ /errors/503/index.html break; + } + + location @mediawiki { + rewrite ^/(.*)$ /index.php?title=$1&$args last; + } + + location ~ \.php$ { + fastcgi_pass unix:/srv/reevo-2020/run/wiki.socket; + include /etc/nginx/fastcgi_params; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } +} |