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.
 
 
 
 
 

97 lines
3.1 KiB

#
# devuan.org
#
# Development version
#
# Add a fake domain for development:
# echo '127.0.0.1 devuan.invalid' | sudo tee -a /etc/hosts
# Run middleman locally:
# gem install middleman
# middleman server -p 4569
#
upstream devuan_org {
server 127.0.0.1:4569;
}
server {
listen 127.0.0.1:80;
server_name devuan.invalid;
root /srv/www/devuan.invalid/public;
index index.html;
# Old URLs
rewrite ^/communicate.*$ /os/debian-fork permanent;
rewrite ^/donate.*$ /os/donate permanent;
rewrite ^/files/devuan.mp3
/os/download/media/devuan.mp3 permanent;
rewrite ^/files/devuan.wav
/os/download/media/devuan.wav permanent;
rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
/os/download/report/devuan_budget_2014.pdf permanent;
rewrite ^/devuan_financial_report_2015.pdf
/os/download/report/devuan_financial_report_2015.pdf permanent;
rewrite ^/newsletter_22dec.html
/os/debian-fork/newsletter-12014-12-22 permanent;
rewrite ^/pub.key /os/download/devuan-primary-signing-key.pub permanent;
# Old dismissed locations
# Mirror: comment out if that interferes with your site.
location ^/(css|img|js) { return 404; }
# Is this still needed?
location = /google1b5b85f34f8aa7f8.html {
echo "google-site-verification: google1b5b85f34f8aa7f8.html";
}
# Virtual /my Devuan
location /my {
set $gdo https://git.devuan.org;
set $tdo https://talk.devuan.org;
rewrite ^/my/dashboard $gdo/dashboard redirect;
rewrite ^/my/milestones $gdo/dashboard/milestones redirect;
rewrite ^/my/todo.* $gdo/dashboard/todos?state=pending redirect;
rewrite ^/my/activity $tdo/my/activity redirect;
rewrite ^/my/bookmarks $tdo/my/activity/bookmarks redirect;
rewrite ^/my/messages $tdo/my/messages redirect;
rewrite ^/my/preferences $tdo/my/preferences redirect;
rewrite ^/my/profile $tdo/my/profile redirect;
return 403;
}
# Localize error pages
# Defaults to English
# MIRROR: change /en for your locale!
error_page 403 /en/error/403.html;
error_page 404 /en/error/404.html;
error_page 501 502 503 /en/error/50x.html;
location ~ ^/(de|en|es|fr|it) {
try_files $uri $uri.html $uri/ @backend;
error_page 403 /$1/error/403.html;
error_page 404 /$1/error/404.html;
error_page 501 502 503 /$1/error/50x.html;
}
location / {
try_files $uri $uri.html $uri/ @backend;
error_page 403 /en/error/403.html;
error_page 404 /en/error/404.html;
error_page 501 502 503 /en/error/50x.html;
}
# Links are made like this: /:locale/path
# But English is the default language, so we skip /en
# MIRROR: you may want to switch to your language instead!
rewrite ^/en/(.*)$ /$1 last;
# rewrite ^/fr/(.*)$ /$1 last; # French mirror example
location @backend {
return 404; # Comment this if you want to run middleman locally
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors off;
proxy_pass http://devuan_org;
}
}