From: Sarah Hoffmann Date: Mon, 2 Feb 2026 21:00:47 +0000 (+0100) Subject: nominatim: switch to asgi/uwsgi protocol for gunicorn X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain nominatim: switch to asgi/uwsgi protocol for gunicorn --- diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 5bbebb44e..ad17d2794 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -198,7 +198,7 @@ systemd_service "nominatim" do working_directory project_directory standard_output "append:#{node[:nominatim][:logdir]}/gunicorn.log" standard_error "inherit" - exec_start "#{python_directory}/bin/gunicorn --max-requests 200000 -b unix:/run/gunicorn-nominatim.openstreetmap.org.sock -w #{node[:nominatim][:api_workers]} -k uvicorn.workers.UvicornWorker 'nominatim_api.server.falcon.server:run_wsgi()'" + exec_start "#{python_directory}/bin/gunicorn --max-requests 500000 -b unix:/run/gunicorn-nominatim.openstreetmap.org.sock -w #{node[:nominatim][:api_workers]} --worker-class asgi --worker-connections 1000 --protocol uwsgi 'nominatim_api.server.falcon.server:run_wsgi()'" exec_reload "/bin/kill -s HUP $MAINPID" kill_mode "mixed" timeout_stop_sec 5 diff --git a/cookbooks/nominatim/templates/default/nginx.erb b/cookbooks/nominatim/templates/default/nginx.erb index ca9c5fd20..4645cc132 100644 --- a/cookbooks/nominatim/templates/default/nginx.erb +++ b/cookbooks/nominatim/templates/default/nginx.erb @@ -223,12 +223,8 @@ server { return 204; } - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Proxy-Connection ""; - proxy_redirect off; - proxy_pass http://nominatim_service; + uwsgi_pass nominatim_service; + include uwsgi_params; add_header Vary "accept-language"; }