Add add.txt & disable unnecessary logging

This commit is contained in:
Tommy 2024-10-13 14:46:21 -07:00 committed by GitHub
parent a1708ef12b
commit 5106e34fb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 0 deletions

View File

@ -4,5 +4,6 @@ add_header X-Robots-Tag "noindex, nofollow" always;
location = /robots.txt { location = /robots.txt {
root /srv/nginx; root /srv/nginx;
allow all; allow all;
log_not_found off;
access_log off; access_log off;
} }

View File

@ -1,3 +1,16 @@
location /.well-known/acme-challenge/ { location /.well-known/acme-challenge/ {
root /srv/nginx; root /srv/nginx;
} }
location = /ads.txt {
root /srv/nginx;
allow all;
log_not_found off;
access_log off;
}
location = /app-ads.txt {
root /srv/nginx;
allow all;
log_not_found off;
access_log off;
}

View File

@ -66,6 +66,8 @@ fi
# Setup webroot for NGINX # Setup webroot for NGINX
## Explicitly using /var/srv here because SELinux does not follow symlinks ## Explicitly using /var/srv here because SELinux does not follow symlinks
sudo semanage fcontext -a -t httpd_sys_content_t "$(realpath /srv/nginx)(/.*)?" sudo semanage fcontext -a -t httpd_sys_content_t "$(realpath /srv/nginx)(/.*)?"
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/srv/nginx/ads.txt | sudo tee /srv/nginx/ads.txt > /dev/null
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/srv/nginx/app-ads.txt | sudo tee /srv/nginx/app-ads.txt > /dev/null
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/srv/nginx/robots.txt | sudo tee /srv/nginx/robots.txt > /dev/null unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/srv/nginx/robots.txt | sudo tee /srv/nginx/robots.txt > /dev/null
sudo mkdir -p /srv/nginx/.well-known/acme-challenge sudo mkdir -p /srv/nginx/.well-known/acme-challenge
sudo chmod -R 755 /srv/nginx/.well-known/acme-challenge sudo chmod -R 755 /srv/nginx/.well-known/acme-challenge

1
srv/nginx/ads.txt Normal file
View File

@ -0,0 +1 @@
placeholder.example.com, placeholder, DIRECT, placeholder

1
srv/nginx/app-ads.txt Normal file
View File

@ -0,0 +1 @@
placeholder.example.com, placeholder, DIRECT, placeholder