UCL-MIRSG / ansible-collection-infra

Ansible Collection to configure infrastructure for XNAT and OMERO
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Change nginx template to accommodate long aws url #121

Closed ruaridhg closed 3 months ago

ruaridhg commented 3 months ago

Getting the following nginx error when running ./install_xnat.sh in xnat-aws repo

nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx.service: Control process exited, code=exited, status=1/FAILURE

The url is too long so don't know if it's possible to make it shorter xnat_web_url = "http://ec2-18-171-61-42.eu-west-2.compute.amazonaws.com" OR adding server_names_hash_bucket_size 128; to the http block within /etc/nginx/nginx.conf which worked when manually changing it on the server

HChughtai commented 3 months ago

The url is too long so don't know if it's possible to make it shorter xnat_web_url = "http://ec2-18-171-61-42.eu-west-2.compute.amazonaws.com/"

I think to make it shorter you'd need to assign a domain name, rather than use the server name directly, so would be an AWS configuration.

adding server_names_hash_bucket_size 128; to the http block within /etc/nginx/nginx.conf which worked when manually changing it on the server

I'm not sure what the downside would be to having an unnecessarily long server_names_hash_bucket_size on our production instances. Could you make it so that the default is the original value, and we can override with a variable?

ruaridhg commented 3 months ago

This has been resolved in the xnat-aws repo so going to close this PR