summaryrefslogtreecommitdiff
path: root/etc/nginx
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2019-01-06 00:20:37 -0300
committerYaco <franco@reevo.org>2019-01-06 00:20:37 -0300
commitdab3fd4a501df5c3fc30b4c9fe79bfada4415958 (patch)
tree3d1971414457ff62418a69b6a95bc4b4e93ab5e9 /etc/nginx
parent71ddfdcf197d529e0964059ad7b796913908f2b3 (diff)
grandes avances previos al primer deployment en reevo.wiki
Diffstat (limited to 'etc/nginx')
-rwxr-xr-xetc/nginx/crm.conf.sample44
-rwxr-xr-xetc/nginx/global.conf.sample28
-rwxr-xr-xetc/nginx/wiki.conf.sample74
3 files changed, 146 insertions, 0 deletions
diff --git a/etc/nginx/crm.conf.sample b/etc/nginx/crm.conf.sample
new file mode 100755
index 00000000..0387c39f
--- /dev/null
+++ b/etc/nginx/crm.conf.sample
@@ -0,0 +1,44 @@
+# ----
+# 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 crm.example.org example.org;
+ root /srv/reevo-web/www/crm;
+
+ access_log /srv/reevo-web/log/crm/nginx.access.log;
+ error_log /srv/reevo-web/log/crm/nginx.error.log warn;
+
+ index index.html index.htm index.php;
+
+ location ~ \.php$ {
+ # Sitio offline
+ if ($maintenance) { return 503; }
+
+ # Bloquea bots
+ if ($limit_bots) { add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; }
+
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass unix:/srv/reevo-web/run/crm.socket;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+
+ add_header Access-Control-Allow-Origin *;
+ rewrite /wp-admin$ $scheme://$host$uri/ permanent;
+ try_files $uri $uri/ /index.php?$args;
+
+ error_page 503 @maintenance;
+ location @maintenance {
+ rewrite ^(.*)$ /errors/503/index.html break;
+ }
+
+ location /wp-content/plugins/files/civicrm/ {
+ deny all;
+ return 404;
+ }
+
+}
diff --git a/etc/nginx/global.conf.sample b/etc/nginx/global.conf.sample
new file mode 100755
index 00000000..94a501d4
--- /dev/null
+++ b/etc/nginx/global.conf.sample
@@ -0,0 +1,28 @@
+# ----
+# 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)
+# ----
+
+## ES: Modo mantenimiento
+## EN: Maintance mode
+geo $maintenance {
+
+ # ES: cambiar a 1 para entrar en modo mantenimiento
+ # EN: change to 1 to enable maintance mode
+ default 0;
+
+ # ES: listado de IP's con acceso cuando se está en modo mantenimiento
+ # EN: list of allowd IPs in MM
+ # 192.168.56.1 0; # IP en contexto de VM
+}
+
+## ES: No indexar en buscadores
+## EN: Avoid indexing by search engines
+map $http_user_agent $limit_bots {
+
+ # ES: cambiar a 1 para evitar que los sitios sean indexados
+ # EN: change to 1 to avoid indexing
+ default 0;
+}
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;
+ }
+}