about summary refs log tree commit diff stats
path: root/tools/conf/etc/nginx
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2020-03-09 20:15:17 +0000
committerSilvino Silva <silvino@bk.ru>2020-03-09 20:15:17 +0000
commit721c5af0bb335b2367121681694ceaa7606b18ce (patch)
treeca8bc506f5ad5a008528f1bbb726abaff1ffe3f8 /tools/conf/etc/nginx
parentbe4c74074a6afeeb0af1d6dc7d94af0c8e226a38 (diff)
downloaddoc-721c5af0bb335b2367121681694ceaa7606b18ce.tar.gz
nginx configuration revision
Diffstat (limited to 'tools/conf/etc/nginx')
-rw-r--r--tools/conf/etc/nginx/nginx.conf3
-rw-r--r--tools/conf/etc/nginx/sites-enabled/default.conf102
-rw-r--r--tools/conf/etc/nginx/sites-enabled/ports.conf55
3 files changed, 115 insertions, 45 deletions
diff --git a/tools/conf/etc/nginx/nginx.conf b/tools/conf/etc/nginx/nginx.conf
index 1339275..e757df6 100644
--- a/tools/conf/etc/nginx/nginx.conf
+++ b/tools/conf/etc/nginx/nginx.conf
@@ -2,11 +2,10 @@
 # /etc/nginx/nginx.conf - nginx server configuration
 #
 
-
 user www;
 worker_processes auto;
 
-error_log syslog:server=unix:/dev/log debug;
+error_log syslog:server=unix:/dev/log,facility=daemon debug;
 
 pid /var/run/nginx.pid;
 
diff --git a/tools/conf/etc/nginx/sites-enabled/default.conf b/tools/conf/etc/nginx/sites-enabled/default.conf
index fb9fb8e..1bb8afd 100644
--- a/tools/conf/etc/nginx/sites-enabled/default.conf
+++ b/tools/conf/etc/nginx/sites-enabled/default.conf
@@ -1,8 +1,19 @@
 server {
+#if ($http_user_agent ~* (AhrefsBot|SemrushBot|MJ12Bot|DotBot)) {
+#     return 410;
+#}
+
+##listen 443 ssl http2;
     server_name tribu.semdestino.org;
 
     listen 80 default_server;
     listen 443 ssl default_server;
+#  listen [::]:443 ssl http2;
+
+    access_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_vhost,nohostname main;
+    error_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_vhost_err,nohostname debug;
+
+    root /etc/nginx/html/;
 
     ssl_certificate /etc/letsencrypt/live/tribu.semdestino.org/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/tribu.semdestino.org/privkey.pem;
@@ -18,62 +29,67 @@ server {
     ssl_stapling on;
     ssl_stapling_verify on;
 
-    access_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_vhost,nohostname main;
-    error_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_vhost_err,nohostname debug;
+#proxy_redirect off;
+#proxy_set_header Host $http_host;
+#proxy_set_header X-Forwarded-Host $http_host;
+#proxy_set_header X-Real-IP $remote_addr;
+#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
-    root /etc/html/;
 
-    location /doc {
-        alias /srv/www/doc;
-        index index.html;
+   location /doc {
+       alias /srv/www/doc;
+       index index.html;
+        autoindex on;
     }
 
-    location /pub {
+   location /mirror {
+       proxy_pass http://c1.ank;
+   }
+
+   location /pub {
+       proxy_pass http://wiki.c2.ank:8080;
+   }
+   location ^~ /.well-known {
+       # ACME challenge
+       proxy_pass http://wiki.c2.ank;
+   }
+   location /wiki {
         proxy_pass http://wiki.c2.ank:8080;
-    }
+   }
 
-    location /wiki {
-        proxy_pass http://wiki.c2.ank:8080;
-    }
+   location /git {
+       proxy_pass http://git.c2.ank:8080;
+   }
 
-    location /git {
-        proxy_pass http://git.c2.ank:8080;
-    }
+   location /forum/ {
+        proxy_pass http://forum.c2.ank:8080/;
+   }
 
-    location /forum {
-        proxy_pass http://forum.c2.ank:8080;
-    }
-
-    location /task {
-        proxy_pass http://task.c2.ank:8080;
-    }
-
-    location /shop {
-        proxy_pass http://shop.c2.ank:8080;
-    }
+   #location /task {
+   #    proxy_pass http://task.c2.ank:8080;
+   #}
 
-    location /email {
-        proxy_pass http://email.c2.ank:8080;
-    }
+   # location /shop {
+   #     proxy_pass http://shop.c2.ank:8080;
+   # }
 
-    location /mirror {
-        proxy_pass http://c1.ank;
-    }
+   location /vexim/ {
+       proxy_pass http://vexim.c2.ank:8080/;
+   }
 
-    location /awstats {
-        proxy_pass http://awstats.c2.ank:8080;
-    }
+   # location /email {
+   #     proxy_pass http://email.c2.ank:8080;
+   # }
 
-    location /stats {
-        proxy_pass http://stats.c2.ank:8080;
-    }
+   # location /awstats {
+   #     proxy_pass http://awstats.c2.ank:8080;
+   # }
 
-    # ACME challenge
-    location ^~ /.well-known {
-        proxy_pass http://wiki.c2.ank;
-    }
+   # location /stats {
+   #     proxy_pass http://stats.c2.ank:8080;
+   # }
 
-    location / {
-        proxy_pass http://frontpage.c2.ank;
+   location / {
+        proxy_pass http://frontpage.c2.ank:8080/;
     }
 }
diff --git a/tools/conf/etc/nginx/sites-enabled/ports.conf b/tools/conf/etc/nginx/sites-enabled/ports.conf
new file mode 100644
index 0000000..829d710
--- /dev/null
+++ b/tools/conf/etc/nginx/sites-enabled/ports.conf
@@ -0,0 +1,55 @@
+server {
+    listen       80;
+    server_name  localhost ports.ank default_host;
+
+    access_log /var/log/nginx/ports_access.log;
+    error_log /var/log/nginx/ports_error.log;
+
+    location /mirror/archive {
+    	autoindex on;
+    	alias /usr/ports/archive;
+    }
+
+    location /mirror/packages {
+    	autoindex on;
+    	alias /usr/ports/packages;
+    }
+
+    location /mirror/distfiles {
+    	autoindex on;
+    	alias /usr/ports/distfiles;
+    }
+    		
+    location /mirror/bugs {
+    	autoindex on;
+    	alias /usr/ports/pkgbuild;
+    	types {
+    		text/plain log;
+    	}
+    }
+
+    location /mirror/installed {
+    	autoindex on;
+    	alias /usr/ports/installed;
+    	default_type text/plain;
+    }
+    	
+    location /mirror/releases {
+    	autoindex on;
+    	alias /usr/ports/releases;
+    }
+
+	location /mirror/ {
+         return 301 https://tribu.semdestino.org/wiki/Main/Mirror;
+    }
+
+    error_page  404              /404.html;
+
+    # redirect server error pages to the static page /50x.html
+    #
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   html;
+    }
+}
+