From 05656d9e54168ec4b8474f01a53ad4ad6789f80c Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Thu, 25 Aug 2016 23:25:48 +0200 Subject: [PATCH] Migrate to initial nginx conf. --- apache.conf | 69 -------------------------------- nginx/base.conf | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ nginx/site.conf | 19 +++++++++ redirects | 35 ---------------- 4 files changed, 122 insertions(+), 104 deletions(-) delete mode 100644 apache.conf create mode 100644 nginx/base.conf create mode 100644 nginx/site.conf delete mode 100644 redirects diff --git a/apache.conf b/apache.conf deleted file mode 100644 index 188b39e..0000000 --- a/apache.conf +++ /dev/null @@ -1,69 +0,0 @@ -WSGIDaemonProcess metanohi.name processes=2 threads=5 display-name=%{GROUP} -WSGIProcessGroup metanohi.name - - - - ServerName metanohi.name - ServerAlias metanohi.name www.metanohi.name nohi.lcl - ServerAdmin ngws@metanohi.name - - DocumentRoot /home/niels/www/meta/nohi - - Alias /robots.txt /home/niels/www/meta/nohi/extra/robots.txt - Alias /favicon.ico /home/niels/www/meta/nohi/extra/favicon.ico - Alias /favicon.png /home/niels/www/meta/nohi/extra/favicon.png - Alias /atom.xml /home/niels/www/meta/nohi/extra/atom.xml - Alias /feedicon.png /home/niels/www/meta/nohi/extra/feedicon.png - Alias /feedlogo.png /home/niels/www/meta/nohi/extra/feedlogo.png - Alias /static /home/niels/www/meta/nohi/static - Alias /heavy /home/niels/www/meta/nohi/heavy - - WSGIScriptAlias / /home/niels/www/meta/nohi/nohi.wsgi - - - Require all granted - - - ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ - - LogLevel warn - ErrorLog /var/log/httpd/metanohi.name-error.log - CustomLog /var/log/httpd/metanohi.name-access.log combined - - - - - - ServerName metanohi.name - ServerAlias metanohi.name www.metanohi.name nohi.lcl - ServerAdmin ngws@metanohi.name - - DocumentRoot /home/niels/www/meta/nohi - - Alias /robots.txt /home/niels/www/meta/nohi/extra/robots.txt - Alias /favicon.ico /home/niels/www/meta/nohi/extra/favicon.ico - Alias /favicon.png /home/niels/www/meta/nohi/extra/favicon.png - Alias /atom.xml /home/niels/www/meta/nohi/extra/atom.xml - Alias /feedicon.png /home/niels/www/meta/nohi/extra/feedicon.png - Alias /feedlogo.png /home/niels/www/meta/nohi/extra/feedlogo.png - Alias /static /home/niels/www/meta/nohi/static - Alias /heavy /home/niels/www/meta/nohi/heavy - - WSGIScriptAlias / /home/niels/www/meta/nohi/nohi.wsgi - - - Require all granted - - - ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ - - LogLevel warn - ErrorLog /var/log/httpd/metanohi.name-error.log - CustomLog /var/log/httpd/metanohi.name-access.log combined - - SSLEngine on - SSLCertificateFile /home/niels/www/meta/metanohi_server.pem - SSLCertificateKeyFile /home/niels/www/meta/metanohi_privatekey.pem - SSLCipherSuite HIGH - SSLProtocol all -SSLv2 - diff --git a/nginx/base.conf b/nginx/base.conf new file mode 100644 index 0000000..24bf500 --- /dev/null +++ b/nginx/base.conf @@ -0,0 +1,103 @@ +server_name metanohi.name www.metanohi.name; + +root /var/www/metanohi.name/web; +index index.html; + +location / { + # Old rewrites. + rewrite ^/projects/aeltei https://git.metanohi.name/aeltei.git/ + rewrite ^/projects/alart https://git.metanohi.name/alart.git/ + rewrite ^/projects/alp https://git.metanohi.name/alp.git/ + rewrite ^/projects/bolg https://git.metanohi.name/bolg.git/ + rewrite ^/projects/desurveil https://git.metanohi.name/desurveil.git/ + rewrite ^/projects/dililatum https://git.metanohi.name/dililatum.git/ + rewrite ^/projects/dotbox https://git.metanohi.name/dotbox.git/ + rewrite ^/projects/dungeoncrawl https://git.metanohi.name/dungeoncrawl.git/ + rewrite ^/projects/electruth https://git.metanohi.name/electruth.git/ + rewrite ^/projects/enigma https://git.metanohi.name/enigma.git/ + rewrite ^/projects/exoskelegram https://git.metanohi.name/exoskelegram.git/ + rewrite ^/projects/forbi https://git.metanohi.name/forbi.git/ + rewrite ^/projects/forestquest https://git.metanohi.name/forestquest.git/ + rewrite ^/projects/gravnoise https://git.metanohi.name/gravnoise.git/ + rewrite ^/projects/hbcht https://git.metanohi.name/hbcht.git/ + rewrite ^/projects/htmlentitiesdecode https://git.metanohi.name/htmlentitiesdecode.git/ + rewrite ^/projects/indirectassassin https://git.metanohi.name/indirectassassin.git/ + rewrite ^/projects/kando https://git.metanohi.name/kando.git/ + rewrite ^/projects/kvigall https://git.metanohi.name/kvigall.git/ + rewrite ^/projects/luncheon https://git.metanohi.name/luncheon.git/ + rewrite ^/projects/movact https://git.metanohi.name/movact.git/ + rewrite ^/projects/naghni https://git.metanohi.name/naghni.git/ + rewrite ^/projects/noncrawl https://git.metanohi.name/noncrawl.git/ + rewrite ^/projects/pebsaq https://git.metanohi.name/pebsaq.git/ + rewrite ^/projects/pumila https://git.metanohi.name/pumila.git/ + rewrite ^/projects/sadbipws https://git.metanohi.name/sadbipws.git/ + rewrite ^/projects/shadowloss https://git.metanohi.name/shadowloss.git/ + rewrite ^/projects/textmation https://git.metanohi.name/textmation.git/ + rewrite ^/projects/wordwork https://git.metanohi.name/wordwork.git/ + rewrite ^/projects/yelljfish https://git.metanohi.name/yelljfish.git/ + rewrite ^/projects/zebralligator https://git.metanohi.name/zebralligator.git/ + + rewrite ^/projects/mege https://git.metanohi.name/mege.git/ + rewrite ^/mege https://git.metanohi.name/mege.git/ + + rewrite ^/projects/wontofor https://git.metanohi.name/wontofor.git/ + rewrite ^/124 https://git.metanohi.name/wontofor.git/ + + rewrite ^/projects/zita https://git.metanohi.name/zita.git/ + rewrite ^/zita https://git.metanohi.name/zita.git/ + rewrite ^/zit https://git.metanohi.name/zita.git/ + + rewrite ^/projects/bito https://git.metanohi.name/bito.git/ + rewrite ^/bito https://git.metanohi.name/bito.git/ + rewrite ^/bit https://git.metanohi.name/bito.git/ + + rewrite ^/projects/totxt https://git.metanohi.name/totxt.git/ + rewrite ^/totxt https://git.metanohi.name/totxt.git/ + rewrite ^/totext https://git.metanohi.name/totxt.git/ + + rewrite ^/projects/canvas https://old-projects.metanohi.name/canvas/ + rewrite ^/canvas https://old-projects.metanohi.name/canvas/ + + rewrite ^/projects/eonaton https://old-projects.metanohi.name/eonaton/ + rewrite ^/eonaton https://old-projects.metanohi.name/eonaton/ + + rewrite ^/projects/evolution https://old-projects.metanohi.name/evolution/ + rewrite ^/evolution https://old-projects.metanohi.name/evolution/ + + rewrite ^/projects/snake https://old-projects.metanohi.name/snake/ + rewrite ^/snake https://old-projects.metanohi.name/snake/ + + rewrite ^/aboutme /about/niels/ + + rewrite ^/projects/nanonote /nanonote/ + + rewrite ^/writings/na /Na/ + rewrite ^/writings/Na\.html$ /Na/ + + rewrite ^/writings/digital-sikring\.html$ digital-sikring + + rewrite ^/bsq https://old-projects.metanohi.name/bsq/ + + rewrite ^/gt3000 https://old-projects.metanohi.name/gt3000/ + + rewrite ^/algo https://old-projects.metanohi.name/algo/ + rewrite ^/algohol https://old-projects.metanohi.name/algo/ + + rewrite ^/dkstp https://old-projects.metanohi.name/dkstp/ + + rewrite ^/jap https://old-projects.metanohi.name/jap/ + + rewrite ^/pedro https://old-projects.metanohi.name/pedro/ + + rewrite ^/snowman https://old-projects.metanohi.name/snowman/ + + rewrite ^/sq https://old-projects.metanohi.name/sq/ + + rewrite ^/webcli https://old-projects.metanohi.name/webcli/ + + rewrite ^/x https://old-projects.metanohi.name/x/ + + + # Ordinary handling. + try_files $uri $uri/ =404; +} diff --git a/nginx/site.conf b/nginx/site.conf new file mode 100644 index 0000000..1e68675 --- /dev/null +++ b/nginx/site.conf @@ -0,0 +1,19 @@ +server { + listen 80; + listen [::]:80; + + include /etc/nginx/snippets/letsencrypt.conf; + include /etc/nginx/basics/metanohi.name.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + ssl_certificate /etc/letsencrypt/live/git.metanohi.name/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/git.metanohi.name/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/git.metanohi.name/fullchain.pem; + + include /etc/nginx/snippets/ssl.conf; + include /etc/nginx/basics/metanohi.name.conf; +} diff --git a/redirects b/redirects deleted file mode 100644 index 537c9d2..0000000 --- a/redirects +++ /dev/null @@ -1,35 +0,0 @@ -## temp -redirect projects/{showandkill,sak} https://gitorious.org/nqpz-config/nqpz-config/blobs/raw/master/home/.emacs.d/site-lisp/showandkill.el - -## old -redirect mege projects/mege/ -redirect aboutme about/niels -redirect about/img-licenses about/media-licenses -redirect 124 projects/wontofor/ -redirect enigma projects/enigma -redirect simplechat projects/simplechat -redirect {zita,zit} projects/zita -redirect {bito,bit} projects/bito -redirect {totxt,totext} projects/totxt/ -redirect an[5s]w projects/an5w/ -redirect projects/{bibbob,wikiaq,drget,ticso} projects/ -redirect {canvas,projects/canvas} http://projects.metanohi.name/canvas/ -redirect {eonaton,projects/eonaton} http://projects.metanohi.name/eonaton/ -redirect {evolution,projects/evolution} http://projects.metanohi.name/evolution/ -redirect {snake,projects/snake} http://projects.metanohi.name/snake/ -redirect {words,projects/words} http://projects.metanohi.name/words/ -redirect {cln,cli} projects/cln/ -redirect nanonote projects/nanonote/ -redirect writings/Na.html writings/na -redirect writings/digital-sikring.html writings/digital-sikring - -redirect bsq http://projects.metanohi.name/bsq/ -redirect gt3000 http://projects.metanohi.name/gt3000/ -redirect {algo,algohol} http://projects.metanohi.name/algo/ -redirect dsktp http://projects.metanohi.name/dsktp/ -redirect jap http://projects.metanohi.name/jap/ -redirect pedro http://projects.metanohi.name/pedro/ -redirect snowman http://projects.metanohi.name/snowman/ -redirect sq http://projects.metanohi.name/sq/ -redirect webcli http://projects.metanohi.name/webcli/ -redirect x http://projects.metanohi.name/x/