From 9f00823fd04cb0cf6c5ff0f5184f41a014b04c57 Mon Sep 17 00:00:00 2001 From: Andrew Wray Date: Mon, 7 Jul 2025 22:22:08 +0100 Subject: [PATCH] Rename map variables for nginx --- cmd/sea/nginx.conf.tmpl | 10 +++++----- nginx.conf | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/sea/nginx.conf.tmpl b/cmd/sea/nginx.conf.tmpl index fc929ae..a353227 100644 --- a/cmd/sea/nginx.conf.tmpl +++ b/cmd/sea/nginx.conf.tmpl @@ -1,6 +1,6 @@ # Map routes search queries to the appropriate backend. # Regex is evaluated once per request; enable `pcre_jit` for best speed. -map $arg_q $dest { +map $arg_q $sea_dest { # direct image search ~*(?i)\bpictures?\s+of\b google_images; # map and direction queries @@ -35,7 +35,7 @@ map $arg_q $dest { } # Map engine names to full URL targets. Update this list in Go. -map $dest $target { +map $sea_dest $sea_target { chatgpt https://chatgpt.com/?q=$arg_q; google https://www.google.com/search?q=$arg_q; google_images https://www.google.com/search?tbm=isch&q=$arg_q; @@ -59,7 +59,7 @@ server { {{- end }} location / { - return 302 $target; + return 302 $sea_target; } } {{ if .RedirectHTTP }} @@ -81,7 +81,7 @@ server { server_name {{ .ServerName }}; location / { - return 302 $target; + return 302 $sea_target; } } {{ end }} @@ -92,7 +92,7 @@ server { server_name {{ .ServerName }}; location / { - return 302 $target; + return 302 $sea_target; } } {{ end }} diff --git a/nginx.conf b/nginx.conf index 4e343cb..64ab506 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,6 +1,6 @@ # Map routes search queries to the appropriate backend. # Regex is evaluated once per request; enable `pcre_jit` for best speed. -map $arg_q $dest { +map $arg_q $sea_dest { # direct image search ~*(?i)\bpictures?\s+of\b google_images; # map and direction queries @@ -32,7 +32,7 @@ map $arg_q $dest { } # Map engine names to full URL targets. Update this list in Go. -map $dest $target { +map $sea_dest $sea_target { chatgpt https://chatgpt.com/?q=$arg_q; google https://www.google.com/search?q=$arg_q; google_images https://www.google.com/search?tbm=isch&q=$arg_q; @@ -43,11 +43,11 @@ map $dest $target { server { listen 80; + listen [::]:80; server_name search.localhost; location / { - return 302 $target; + return 302 $sea_target; } } -