@@ -355,14 +355,18 @@ server {
355355 proxy_pass http://127.0.0.1:4180;
356356 }
357357
358+ location /oauth2/ {
359+ proxy_pass http://127.0.0.1:4180;
360+ proxy_set_header Host $host;
361+ proxy_set_header X-Real-IP $remote_addr;
362+ proxy_set_header X-Scheme $scheme;
363+ }
364+
358365 location / {
359366 auth_request /oauth2/auth;
360− error_page 401 = ...;
367+ error_page 401 = https://example.com/oauth2/sign_in;
361368
362369 root /path/to/the/site;
363− default_type text/html;
364− charset utf-8;
365− charset_types application/json utf-8;
366370 }
367371}
368372```