srobo / ansible

Ansible configuration for Student Robotics' pet machines
MIT License
0 stars 5 forks source link

Redirect /forums to point at the Discord documentation #25

Closed sedders123 closed 1 year ago

sedders123 commented 1 year ago

Summary

We no longer use our own forums, instead a Discord server.

Code review

Testing

$ curl -Ik https://sr-vm/forum ; curl -Ik https://sr-vm/forum/ ; curl -Ik https://sr-vm/forums ; curl -Ik https://sr-vm/forums/
HTTP/2 302 
server: nginx/1.18.0 (Ubuntu)
date: Sat, 22 Oct 2022 09:19:24 GMT
content-type: text/html
content-length: 154
location: https://sr-vm/docs/team_admin/discord
x-frame-options: SAMEORIGIN

HTTP/2 302 
server: nginx/1.18.0 (Ubuntu)
date: Sat, 22 Oct 2022 09:19:25 GMT
content-type: text/html
content-length: 154
location: https://sr-vm/docs/team_admin/discord
x-frame-options: SAMEORIGIN

HTTP/2 302 
server: nginx/1.18.0 (Ubuntu)
date: Sat, 22 Oct 2022 09:19:25 GMT
content-type: text/html
content-length: 154
location: https://sr-vm/docs/team_admin/discord
x-frame-options: SAMEORIGIN

HTTP/2 302 
server: nginx/1.18.0 (Ubuntu)
date: Sat, 22 Oct 2022 09:19:25 GMT
content-type: text/html
content-length: 154
location: https://sr-vm/docs/team_admin/discord
x-frame-options: SAMEORIGIN
TASK [srobo-nginx : Copy our configuration] *************************************
--- before: /etc/nginx/nginx.conf
+++ after: /home/peterjclaw/.ansible/tmp/ansible-local-1361047yku9np0/tmp93h90qmn/nginx.conf
@@ -74,11 +74,6 @@
     #  proxy_pass https://patience.studentrobotics.org/ide/;
     #}

-    location /forum/ {
-      # proxy_pass https://patience.studentrobotics.org/forum/;
-      return 307 /docs/team_admin/discord;
-    }
-
     #location /docs/python/ {
     #  proxy_pass https://patience.studentrobotics.org/docs/python/;
     #}
@@ -173,6 +168,9 @@
     rewrite ^/password             /userman/ permanent;
     rewrite ^/rules                /docs/rules/ permanent;

+    # We now use Discord instead of a self hosted forum
+    rewrite ^/forums?              /docs/team_admin/discord redirect;
+
     # The runbook has replaced trac
     rewrite ^/trac                 /runbook/ permanent;

changed: [monty.studentrobotics.org]