Visit swagger with auth display 500 error

I edit file /etc/nginx/conf.d/pmm.conf,set swagger auth_request on; when I visit swagger it show 500.How can I visit swagger with auth?