1
0

app npm config.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. location /authelia {
  2. internal;
  3. set $upstream_authelia http://<your-authelia-server-ip-and:port>/api/verify; #ADD YOUR IP AND PORT OF AUTHELIA
  4. proxy_pass_request_body off;
  5. proxy_pass $upstream_authelia;
  6. proxy_set_header Content-Length "";
  7. # Timeout if the real server is dead
  8. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
  9. client_body_buffer_size 128k;
  10. proxy_set_header Host $host;
  11. proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-For $remote_addr;
  14. proxy_set_header X-Forwarded-Proto $scheme;
  15. proxy_set_header X-Forwarded-Host $http_host;
  16. proxy_set_header X-Forwarded-Uri $request_uri;
  17. proxy_set_header X-Forwarded-Ssl on;
  18. proxy_redirect http:// $scheme://;
  19. proxy_http_version 1.1;
  20. proxy_set_header Connection "";
  21. proxy_cache_bypass $cookie_session;
  22. proxy_no_cache $cookie_session;
  23. proxy_buffers 4 32k;
  24. send_timeout 5m;
  25. proxy_read_timeout 240;
  26. proxy_send_timeout 240;
  27. proxy_connect_timeout 240;
  28. }
  29. location / {
  30. set $upstream_tree http://150.107.72.154:9010; #ADD IP AND PORT OF SERVICE
  31. proxy_pass $upstream_tree; #change name of the service
  32. auth_request /authelia;
  33. auth_request_set $target_url $scheme://$http_host$request_uri;
  34. auth_request_set $user $upstream_http_remote_user;
  35. auth_request_set $groups $upstream_http_remote_groups;
  36. proxy_set_header Remote-User $user;
  37. proxy_set_header Remote-Groups $groups;
  38. error_page 401 =302 https://auth.ourfamily.group/?rd=$target_url;
  39. client_body_buffer_size 128k;
  40. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
  41. send_timeout 5m;
  42. proxy_read_timeout 360;
  43. proxy_send_timeout 360;
  44. proxy_connect_timeout 360;
  45. proxy_set_header Host $host;
  46. proxy_set_header X-Real-IP $remote_addr;
  47. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  48. proxy_set_header X-Forwarded-Proto $scheme;
  49. proxy_set_header X-Forwarded-Host $http_host;
  50. proxy_set_header X-Forwarded-Uri $request_uri;
  51. proxy_set_header X-Forwarded-Ssl on;
  52. proxy_redirect http:// $scheme://;
  53. proxy_http_version 1.1;
  54. proxy_set_header Connection "";
  55. proxy_cache_bypass $cookie_session;
  56. proxy_no_cache $cookie_session;
  57. proxy_buffers 64 256k;
  58. set_real_ip_from 172.19.0.0/16;
  59. real_ip_header X-Forwarded-For;
  60. real_ip_recursive on;
  61. }