localsearch works on netlify preview, but not on nginx deployment

5 views
Skip to first unread message

matti picus

unread,
Mar 9, 2021, 4:10:27 PMMar 9
to nikola-discuss
Thanks for nikola. I have a question that is most likely not Nikola related, but has me stumped. We (pypy.org) are just now rolling out blog posts in addition to our static pages. I enabled the localsearch plugin and it looks great on the pre-deploy preview at


But when we deploy it to


the page gives a 404. On the nginx server logs, I see the request for

"GET /search.html/?q=%22cape+town%22 HTTP/1.1"

results in the error

[error] 26634#26634: *7314 "/srv/pypy/pypy.org/search.html/index.html" is not found (20: Not a directory)

Any thoughts?

matti picus

unread,
Mar 9, 2021, 4:37:18 PMMar 9
to nikola-discuss
Got it - there is an extra / in the URL before the query parameters, so this is what I am getting
https://www.pypy.org/search.html/?q=%22cape+town%22
and this is what I need
https://www.pypy.org/search.html?q=%22cape+town%22

Now where is that extra / coming from?

matti picus

unread,
Mar 9, 2021, 4:45:58 PMMar 9
to nikola-discuss
Surprise! It was me, I had added an extra slash in the form action, so it was

<form class="navbar-form navbar-left" action="/search.html/" role="search">

and needed to be

<form class="navbar-form navbar-left" action="/search.html" role="search">

Thanks again, sorry for the noise

Matti
Reply all
Reply to author
Forward
0 new messages