- VPS project: https://tools.wmflabs.org/openstack-browser/project/wikidata-primary-sources-tool
- Instance: https://tools.wmflabs.org/openstack-browser/server/pst.wikidata-primary-sources-tool.eqiad.wmflabs
The project Web services need to keep connections alive using the nginx upstream and keepalive directives: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
I tested the following nginx configuration on a third-party server, which seems to work just fine.
- File: /etc/nginx/sites-enabled/pst
- sample content:
upstream ka { server localhost:9999; ###localhost must be replaced with the instance IP keepalive 32; } server { listen ###public IP here###; location /pst/curate { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass_header Set-Cookie; proxy_pass http://ka/pst/curate; proxy_http_version 1.1; proxy_set_header Connection ""; } }
- I've been digging for specific documentation on how to achieve this on VPS projects, with no success;
- I also blindly tried to use the puppet class profile::dumps::web::nginx, with no success:
- the class makes /etc/nginx available;
- added /etc/nginx/sites-enabled/pstwith the above configuration;
- replaced localhost with 10.68.22.221 (i.e., the instance IP);
- sudo nginx -s reload.
Any guidance on this is super appreciated, and I'll gladly create a documentation page on wikitech afterwards.