diff --git a/common/fulltextrss.conf b/common/fulltextrss.conf new file mode 100644 index 0000000..11793c7 --- /dev/null +++ b/common/fulltextrss.conf @@ -0,0 +1,16 @@ +add_header Onion-Location http://ftr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri; +add_header X-I2P-Location http://vernz3gvdqo6dtfaqmbwqrgzfmhwblfbonvtumo63f3q3h7cr5eq.b32.i2p$request_uri; + +root /var/www/full-text-rss; +index index.php index.html index.htm; + +location / { + try_files $uri $uri/ /index.php; +} + +location ~ \.php$ { + fastcgi_pass unix:/run/php/php7.4-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include /etc/nginx/snippets/fastcgi.conf; +} diff --git a/common/website.conf b/common/website.conf index 1f0fda7..cbdfd0b 100644 --- a/common/website.conf +++ b/common/website.conf @@ -48,12 +48,27 @@ location / { } } +error_page 403 /en/errors/403; +error_page 404 /en/errors/404; +error_page 503 /en/errors/503; + location /en { try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php; error_page 403 /en/errors/403; error_page 404 /en/errors/404; error_page 503 /en/errors/503; } +location ~ (\.cgi|\.py|\.sh|\.pl|\.lua|\/cgi-bin)$ { + gzip off; + fastcgi_pass unix:/run/fcgiwrap.socket; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; +} +location /pt-BR { + try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php; + error_page 403 /pt-BR/errors/403; + error_page 404 /pt-BR/errors/404; + error_page 503 /pt-BR/errors/503; +} location ~^/[^u~].*\.(jpg|jpeg|png|gif|ico)$ { expires 30d; diff --git a/conf.d/00website.conf b/conf.d/00website.conf index 239a248..6c53039 100644 --- a/conf.d/00website.conf +++ b/conf.d/00website.conf @@ -1,6 +1,7 @@ map $http_accept_language $lang { default en; ~en en; + pt pt-BR; ~es es; ~fr fr; } diff --git a/conf.d/fulltextrss.conf b/conf.d/fulltextrss.conf new file mode 100644 index 0000000..601ad50 --- /dev/null +++ b/conf.d/fulltextrss.conf @@ -0,0 +1,33 @@ +server { + listen 80; + listen [::]:80; + + server_name ftr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion fulltextrss.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + include common/fulltextrss.conf; +} + +server { + listen 11012; + listen [::]:11012; + + server_name vernz3gvdqo6dtfaqmbwqrgzfmhwblfbonvtumo63f3q3h7cr5eq.b32.i2p; + + include common/fulltextrss.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name ftr.vern.cc fulltextrss.vern.cc; + include snippets/lets-encrypt.conf; + include common/fulltextrss.conf; +} + +server { + listen 80; + listen [::]:80; + return 301 https://$host$request_uri; + server_name ftr.vern.cc fulltextrss.vern.cc; +} +