Main repository for Devuan's www.devuan.org.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

103 lines
3.3 KiB

  1. #
  2. # devuan.org
  3. #
  4. # Development version
  5. #
  6. # Add a fake domain for development:
  7. # echo '127.0.0.1 devuan.invalid' | sudo tee -a /etc/hosts
  8. # Run middleman locally:
  9. # gem install middleman
  10. # middleman server -p 4569
  11. #
  12. upstream devuan_org {
  13. server 127.0.0.1:4569;
  14. }
  15. server {
  16. listen 127.0.0.1:80;
  17. server_name devuan.invalid;
  18. root /srv/www/devuan.invalid/public;
  19. index index.html;
  20. # Old URLs
  21. rewrite ^/communicate.*$ /os/debian-fork permanent;
  22. rewrite ^/donate.*$ /os/donate permanent;
  23. rewrite ^/files/devuan.mp3
  24. /os/download/media/devuan.mp3 permanent;
  25. rewrite ^/files/devuan.wav
  26. /os/download/media/devuan.wav permanent;
  27. rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
  28. /os/download/report/devuan_budget_2014.pdf permanent;
  29. rewrite ^/devuan_financial_report_2015.pdf
  30. /os/download/report/devuan_financial_report_2015.pdf permanent;
  31. rewrite ^/newsletter_22dec.html
  32. /os/debian-fork/newsletter-12014-12-22 permanent;
  33. rewrite ^/pub.key /os/keyring/repository@devuan.org.asc permanent;
  34. # Old dismissed locations
  35. # Mirror: comment out if that interferes with your site.
  36. location ^/(css|img|js) { return 404; }
  37. # Is this still needed?
  38. location = /google1b5b85f34f8aa7f8.html {
  39. echo "google-site-verification: google1b5b85f34f8aa7f8.html";
  40. }
  41. # Virtual /my Devuan
  42. location /my {
  43. set $gdo https://git.devuan.org;
  44. set $tdo https://talk.devuan.org;
  45. rewrite ^/my/dashboard $gdo/dashboard redirect;
  46. rewrite ^/my/milestones $gdo/dashboard/milestones redirect;
  47. rewrite ^/my/todo.* $gdo/dashboard/todos?state=pending redirect;
  48. rewrite ^/my/activity $tdo/my/activity redirect;
  49. rewrite ^/my/bookmarks $tdo/my/activity/bookmarks redirect;
  50. rewrite ^/my/messages $tdo/my/messages redirect;
  51. rewrite ^/my/preferences $tdo/my/preferences redirect;
  52. rewrite ^/my/profile $tdo/my/profile redirect;
  53. return 403;
  54. }
  55. location ~ ^(/os/releases) {
  56. rewrite ^/os/releases/stable $1/jessie last;
  57. rewrite ^/os/releases/testing $1/ascii last;
  58. rewrite ^/os/releases/unstable $1/ceres last;
  59. }
  60. # Localize error pages
  61. # Defaults to English
  62. # MIRROR: change /en for your locale!
  63. error_page 403 /en/error/403.html;
  64. error_page 404 /en/error/404.html;
  65. error_page 501 502 503 /en/error/50x.html;
  66. location ~ ^/(de|en|es|fr|it) {
  67. try_files $uri $uri.html $uri/ @backend;
  68. error_page 403 /$1/error/403.html;
  69. error_page 404 /$1/error/404.html;
  70. error_page 501 502 503 /$1/error/50x.html;
  71. }
  72. location / {
  73. try_files $uri $uri.html $uri/ @backend;
  74. error_page 403 /en/error/403.html;
  75. error_page 404 /en/error/404.html;
  76. error_page 501 502 503 /en/error/50x.html;
  77. }
  78. # Links are made like this: /:locale/path
  79. # But English is the default language, so we skip /en
  80. # MIRROR: you may want to switch to your language instead!
  81. rewrite ^/en/(.*)$ /$1 last;
  82. # rewrite ^/fr/(.*)$ /$1 last; # French mirror example
  83. location @backend {
  84. return 404; # Comment this if you want to run middleman locally
  85. proxy_set_header Host $host;
  86. proxy_set_header X-Real-IP $remote_addr;
  87. proxy_intercept_errors off;
  88. proxy_pass http://devuan_org;
  89. }
  90. }