Custom 302 redirect on nonexistent public project

When not logged in and requesting a nonexistent project vi /public/project name, GitLab redirects to the login page. How can I change this behavior so it redirects to the top-level /public page?

Thanks,

–Chris

This doesn’t seem to work:

nginx[‘custom_gitlab_server_config’] = “error_page 404 /public;\n\nfastcgi_intercept_errors on;\n\n”

Nor this:

nginx[‘custom_gitlab_server_config’] = “try_files $uri $uri/ /public;\n\nfastcgi_intercept_errors on;\n\n”

I guess the redirect isn’t coming from nginx then.

Ah, well missing paths return a 302 anyway, not a 404:

curl -IL -XGET https://example.com/groupname/asdfasdf
HTTP/1.1 302 Found
Server: nginx
Date: Fri, 02 Jun 2017 23:09:34 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 109
Cache-Control: no-cache
Location: https://example.com/users/sign_in

Is what I need possible then?