@@ -53,7 +53,7 @@ from flask_babel import Babel, gettext, format_date, format_decimal
5353from flask.json import jsonify
5454from searx import settings, searx_dir, searx_debug
5555from searx.engines import (
56− categories, engines, get_engines_stats, engine_shortcuts
56+ categories, engines, engine_shortcuts, get_engines_stats, initialize_engines
5757)
5858from searx.utils import (
5959 UnicodeWriter, highlight_content, html_to_text, get_themes,
@@ -81,7 +81,7 @@ except ImportError:
8181
8282# serve pages with HTTP/1.1
8383from werkzeug.serving import WSGIRequestHandler
84−WSGIRequestHandler.protocol_version = "HTTP/1.1"
84+WSGIRequestHandler.protocol_version = "HTTP/{}".format(settings['server'].get('http_protocol_version', '1.0'))
8585
8686static_path, templates_path, themes =\
8787 get_themes(settings['ui']['themes_path']
@@ -769,6 +769,9 @@ def page_not_found(e):
769769
770770
771771def run():
772+ if not searx_debug or os.environ.get("WERKZEUG_RUN_MAIN") == "true":
773+ initialize_engines(settings['engines'])
774+
772775 app.run(
773776 debug=searx_debug,
774777 use_debugger=searx_debug,