and it gets enabled but when we restart container it disables the configured access, how we can make it persistent, anything to be added in Dockerfile or in startup scripts so that whenever container is restarted it will be still there.
Nexus stores this information in a database, if the setting is being reset then that suggests your deployment doesn’t have a persistent storage for the database (which will cause data loss generally).