X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5abec720d8b1a7dc6df7a0e0d7892c347382ddcc..7080a13c54ea467b221bb689e7525a77bea020ab:/docs/admin/Setup-Nominatim-UI.md?ds=sidebyside diff --git a/docs/admin/Setup-Nominatim-UI.md b/docs/admin/Setup-Nominatim-UI.md index 818ea408..cab2d2ed 100644 --- a/docs/admin/Setup-Nominatim-UI.md +++ b/docs/admin/Setup-Nominatim-UI.md @@ -10,15 +10,20 @@ installation. For more details, please also have a look at the ## Installing nominatim-ui -nominatim-ui does not need any special installation, just download, configure -and run it. +We provide regular releases of nominatim-ui that contain the packaged website. +They do not need any special installation. Just download, configure +and run it. Grab the latest release from +[nominatim-ui's Github release page](https://github.com/osm-search/nominatim-ui/releases) +and unpack it. You can use `nominatim-ui-x.x.x.tar.gz` or `nominatim-ui-x.x.x.zip`. -Clone the source from github: +Next you need to adapt the UI to your installation. Custom settings need to be +put into `dist/theme/config.theme.js`. At a minimum you need to +set `Nominatim_API_Endpoint` to point to your Nominatim installation: - git clone https://github.com/osm-search/nominatim-ui + cd nominatim-ui + echo "Nominatim_Config.Nominatim_API_Endpoint='https://myserver.org/nominatim/';" > dist/theme/config.theme.js -Adapt the configuration `dist/config.js` to your needs. You need at least -to change the `Nominatim_API_Endpoint` to point to your Nominatim installation. +For the full set of available settings, have a look at `dist/config.defaults.js`. Then you can just test it locally by spinning up a webserver in the `dist` directory. For example, with Python: @@ -66,11 +71,11 @@ map $args $format { ~(^|&)format= other; } -# Determine from the URI and the format parameter aboce if forwarding is needed. +# Determine from the URI and the format parameter above if forwarding is needed. map $uri/$format $forward_to_ui { default 1; # The default is to forward. ~^/ui 0; # If the URI point to the UI already, we are done. - ~/other$ 0; # An explicit non-html format paramter. No forwarding. + ~/other$ 0; # An explicit non-html format parameter. No forwarding. ~/reverse.*/default 0; # Reverse and lookup assume xml format when ~/lookup.*/default 0; # no format parameter is given. No forwarding. } @@ -87,14 +92,14 @@ rewrite ^/$ /search; location @php { # fastcgi stuff.. if ($forward_to_ui) { - rewrite ^(/[^/]*) http://nominatim.loar/ui$1.html redirect; + rewrite ^(/[^/]*) https://yourserver.com/ui$1.html redirect; } } location ~ [^/]\.php(/|$) { # fastcgi stuff.. if ($forward_to_ui) { - rewrite (.*).php http://nominatim.loar/ui$1.html redirect; + rewrite (.*).php https://yourserver.com/ui$1.html redirect; } } ``` @@ -156,24 +161,16 @@ directory like this: # If no endpoint is given, then use search. RewriteRule ^(/|$) "search.php" - # If format-html is explicity requested, forward to the UI. + # If format-html is explicitly requested, forward to the UI. RewriteCond %{QUERY_STRING} "format=html" - RewriteRule ^([^/]+).php ui/$1.html [R,END] - # Same but .php suffix is missing. - RewriteCond %{QUERY_STRING} "format=html" - RewriteRule ^([^/]+) ui/$1.html [R,END] + RewriteRule ^([^/]+)(.php)? ui/$1.html [R,END] # If no format parameter is there then forward anything # but /reverse and /lookup to the UI. RewriteCond %{QUERY_STRING} "!format=" RewriteCond %{REQUEST_URI} "!/lookup" RewriteCond %{REQUEST_URI} "!/reverse" - RewriteRule ^([^/]+).php ui/$1.html [R,END] - # Same but .php suffix is missing. - RewriteCond %{QUERY_STRING} "!format=" - RewriteCond %{REQUEST_URI} "!/lookup" - RewriteCond %{REQUEST_URI} "!/reverse" - RewriteRule ^([^/]+) ui/$1.html [R,END] + RewriteRule ^([^/]+)(.php)? ui/$1.html [R,END] ```