68 lines
2.2 KiB
Text
Executable file
68 lines
2.2 KiB
Text
Executable file
server {
|
|
access_log /var/log/nginx/searx.log;
|
|
error_log /dev/null;
|
|
|
|
server_name search2.zzls.xyz;
|
|
|
|
|
|
if ($server_protocol ~* "HTTP/1.0") {
|
|
return 444;
|
|
}
|
|
if ($http_user_agent ~* (python) ) {
|
|
return 403;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8888/;
|
|
|
|
#
|
|
proxy_http_version 1.1;
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
# Proxy headers for the Limiter
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Connection $http_connection;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Scheme $scheme;
|
|
|
|
}
|
|
|
|
location /searx/static/ {
|
|
alias /usr/local/searxng/searxng-src/searx/static/;
|
|
}
|
|
|
|
# security headers
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
add_header Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self'; form-action 'self'; 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 https://www.youtube-nocookie.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";
|
|
add_header Permissions-Policy "interest-cohort=()" always;
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
# QUIC
|
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
|
|
quic_retry on;
|
|
quic_gso on;
|
|
ssl_early_data on;
|
|
|
|
listen 443 http3;
|
|
listen 443 http2 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/search2.zzls.xyz/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/search2.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 = search2.zzls.xyz) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
|
|
listen 80;
|
|
|
|
server_name search2.zzls.xyz;
|
|
return 404; # managed by Certbot
|
|
|
|
|
|
}
|