Add librex

This commit is contained in:
Selfhost Root 2023-02-03 13:19:31 -03:00
parent 165d53713b
commit f17dbb5411
3 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,80 @@
server {
access_log /dev/null;
error_log /dev/null;
server_name librex.zzls.xyz;
include configs/general.conf;
root /var/www/librex;
index index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
# Onion Service Header
add_header Onion-Location http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion$request_uri;
# QUIC
add_header Alt-Svc 'h3=":443"; ma=86400';
# CSP + Security Headers
include configs/securityheaders.conf;
#add_header Permissions-Policy "interest-cohort=()" always;
#add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
#add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self' https://github.com/tiekoetter/searxng/issues/new; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src 'self' https://www.youtube-nocookie.com https://invidious.tiekoetter.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com https://open.spotify.com/" always;
quic_retry on;
quic_gso on;
ssl_early_data on;
listen 443 http3;
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/librex.zzls.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/librex.zzls.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
listen 80;
server_name librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion;
root /var/www/librex;
index index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
}
server {
listen 40021;
server_name 7huurwog32tny663wkglrhozfoyqyqmsuxjbd7dtudccx44awjda.b32.i2p;
root /var/www/librex;
index index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
}
server {
if ($host = librex.zzls.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name librex.zzls.xyz;
return 404; # managed by Certbot
}

View File

@ -0,0 +1,59 @@
server {
access_log /var/log/nginx/wiki.zzls.xyz.access.log combined;
error_log /var/log/nginx/wiki.zzls.xyz.error.log;
server_name wiki.zzls.xyz;
# Security headers and general settings
include configs/securityheaders.conf;
include configs/general.conf;
root /opt/dokuwiki;
index doku.php;
#Remember to comment the below out when you are installing DokuWiki, and uncomment it when you are done.
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } # secure Dokuwiki
location ~^/\.ht { deny all; } # also secure the Apache .htaccess files
location @dokuwiki {
#rewrites "doku.php/" out of the URLs if you set the userewrite setting to .htaccess in dokuwiki config page
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
}
location / { try_files $uri $uri/ @dokuwiki; }
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
# QUIC
add_header Alt-Svc 'h3=":443"; ma=86400';
<<<<<<< HEAD
#listen 443 http3;
=======
listen 443 http3;
>>>>>>> 8b6f976fe8e457df02c4ba50a64bafdf969df8dd
listen 443 http2 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wiki.zzls.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wiki.zzls.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = wiki.zzls.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name wiki.zzls.xyz;
return 404; # managed by Certbot
}

View File

@ -0,0 +1 @@
../sites-available/librex.zzls.xyz.conf