diff options
| author | Miguel Dalberto Pedro <miguel.pedro@precisioninno.com> | 2026-10-29 12:48:06 -0300 |
|---|---|---|
| committer | Miguel Dalberto Pedro <miguel.pedro@precisioninno.com> | 2026-10-29 12:48:06 -0300 |
| commit | 4b7379914a1865f07b2c54252234cc90158fc253 (patch) | |
| tree | a476c7e08bb994034d7d04b5b1cdfce216f49c43 /roles/nginx/templates/site-searxng.conf.j2 | |
| download | my-infra-4b7379914a1865f07b2c54252234cc90158fc253.tar.gz my-infra-4b7379914a1865f07b2c54252234cc90158fc253.zip | |
feat(iac): establish Ansible baseline for Nginx, SearXNG, Valkey, and Certbot
- Reverse-engineer live Debian 13 (trixie) VPS state at miguelpedro.xyz.br
- Add modular Ansible roles: common, certbot, valkey, searxng, and nginx
- Encrypt SearXNG secret_key using ansible-vault in group_vars/all/vault.yml
- Cleanly remove unused example.com Nginx stub symlink (sites-enabled/miguelpedro.xyz.br)
- Scaffold cgit + fcgiwrap role (cgit_enabled: false) for upcoming deployment
- Add DISCOVERY_REPORT.md, COMMAND_LOG.md, README.md, and AGENT_INSTRUCTIONS.md with Self-Updating Protocol
Diffstat (limited to 'roles/nginx/templates/site-searxng.conf.j2')
| -rw-r--r-- | roles/nginx/templates/site-searxng.conf.j2 | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/roles/nginx/templates/site-searxng.conf.j2 b/roles/nginx/templates/site-searxng.conf.j2 new file mode 100644 index 0000000..67a5a2d --- /dev/null +++ b/roles/nginx/templates/site-searxng.conf.j2 @@ -0,0 +1,47 @@ +server { + server_name {{ searxng_domain }}; + + # Disable logging for user privacy + access_log /dev/null; + error_log /dev/null; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header Referrer-Policy "no-referrer" always; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + location / { + uwsgi_pass unix://{{ searxng_socket_path }}; + + include uwsgi_params; + + uwsgi_param HTTP_HOST $host; + uwsgi_param HTTP_CONNECTION $http_connection; + + # see flaskfix.py + uwsgi_param HTTP_X_SCHEME $scheme; + + # see limiter.py + uwsgi_param HTTP_X_REAL_IP $remote_addr; + uwsgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for; + } + + listen 443 ssl; # managed by Certbot + listen [::]:443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/{{ searxng_domain }}/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/{{ searxng_domain }}/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 = {{ searxng_domain }}) { + return 301 https://$host$request_uri; + } # managed by Certbot + + listen 80; + listen [::]:80; + server_name {{ searxng_domain }}; + return 404; # managed by Certbot +} |
