@@ -7,31 +7,39 @@ server {
77 # error_log /var/log/nginx/error.log debug;
88 # command: [nginx-debug, '-g', 'daemon off;']
99
10- # n7m-app - exposing reverse geocoding without an extension
11- location /api/v4/reverse {
12- root /nominatim/website;
13- fastcgi_param SCRIPT_FILENAME "$document_root/reverse.php";
14- fastcgi_pass app:9000;
15- include fastcgi_params;
16- }
17- # n7m-app - PHP endpoints
10+ # n7m-app - Python endpoint
1811 location /api/v4/ {
19- root /nominatim/website;
20- fastcgi_split_path_info ^/api/v4(/.+\.php)()$;
21- fastcgi_param SCRIPT_FILENAME "$document_root$fastcgi_script_name";
22- fastcgi_pass app:9000;
23- include fastcgi_params;
12+ rewrite /api/v4/(.*) /$1 break;
13+ proxy_set_header Host $http_host;
14+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
15+ proxy_set_header X-Forwarded-Proto $scheme;
16+ proxy_set_header Upgrade $http_upgrade;
17+ proxy_set_header Connection $connection_upgrade;
18+ proxy_redirect off;
19+ proxy_buffering off;
20+ proxy_pass http://app:8000;
2421 }
25- # n7m-app - health endponnt
22+
23+ # n7m-app - Python health endpoint
2624 location /health {
27- root /nominatim/website;
28- fastcgi_param SCRIPT_FILENAME "$document_root/status.php";
29- fastcgi_pass app:9000;
30- include fastcgi_params;
25+ rewrite /health /status.php break;
26+ proxy_set_header Host $http_host;
27+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
28+ proxy_set_header X-Forwarded-Proto $scheme;
29+ proxy_set_header Upgrade $http_upgrade;
30+ proxy_set_header Connection $connection_upgrade;
31+ proxy_redirect off;
32+ proxy_buffering off;
33+ proxy_pass http://app:8000;
3134 }
3235
3336 # n7m-ui
3437 location / {
3538 proxy_pass http://ui;
3639 }
3740}
41+
42+ map $http_upgrade $connection_upgrade {
43+ default upgrade;
44+ '' close;
45+ }
0 commit comments