Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/sea/nginx.conf.tmpl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -59,7 +59,7 @@ server {
{{- end }}

location / {
return 302 $target;
return 302 $sea_target;
}
}
{{ if .RedirectHTTP }}
Expand All @@ -81,7 +81,7 @@ server {
server_name {{ .ServerName }};

location / {
return 302 $target;
return 302 $sea_target;
}
}
{{ end }}
Expand All @@ -92,7 +92,7 @@ server {
server_name {{ .ServerName }};

location / {
return 302 $target;
return 302 $sea_target;
}
}
{{ end }}
8 changes: 4 additions & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -43,11 +43,11 @@ map $dest $target {

server {
listen 80;
listen [::]:80;
server_name search.localhost;

location / {
return 302 $target;
return 302 $sea_target;
}
}