From cfad296283b289746d31d5a0ab0d25f76f53fabe Mon Sep 17 00:00:00 2001 From: Yaco Date: Sun, 6 Jan 2019 00:51:48 -0300 Subject: corrige sample de nginx --- etc/nginx/wiki.conf.sample | 53 +++++++++------------------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) (limited to 'etc') diff --git a/etc/nginx/wiki.conf.sample b/etc/nginx/wiki.conf.sample index fbb036fa..fab5e545 100755 --- a/etc/nginx/wiki.conf.sample +++ b/etc/nginx/wiki.conf.sample @@ -14,61 +14,28 @@ server { 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; + location / { + index index.php; + try_files $uri $uri/ @mediawiki; } - # 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; + add_header Cache-Control "public"; + expires 7d; } - 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 = /robots.txt { } location @mediawiki { - rewrite ^/(.*)$ /index.php?title=$1&$args last; + rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last; } - location ~ \.php$ { - fastcgi_pass unix:/srv/reevo-2020/run/wiki.socket; + location ~ \.php?$ { include /etc/nginx/fastcgi_params; + fastcgi_pass unix:/srv/reevo-2020/run/wiki.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } + } -- cgit v1.2.1