使用nginx['custom_gitlab_server_config']配置浏览器访问限制

使用nginx[‘custom_gitlab_server_config’] = "location ^~ /.well-known/openid-configuration {\n deny all;\n}\n"和nginx[‘custom_gitlab_server_config’] = "location ^~ /robots.txt {\n deny all;\n}\n"限制访问,为什么只有最后一条生效

两个相同的配置,只有最后一个会生效,因此想要多条同时生效,只能使用一条配置。实例如下:

nginx['custom_gitlab_server_config'] = "location ^~ /robots.txt {\n deny all;\n}\nlocation ^~ /.well-known/openid-configuration {\n deny all;\n}\n"