caddy.json 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {
  2. "admin": {"disabled": true},
  3. "apps": {
  4. "http": {
  5. "servers": {
  6. "srv0": {"listen": [":80"],"routes": [{"handle": [{"handler": "subroute","routes": [{"handle": [{"handler": "static_response","headers": {"Location": ["https://{http.request.host}{http.request.uri}"]},"status_code": 301}]}]}],"terminal": true}]},
  7. "srv1": {
  8. "listen": ["127.0.0.1:50080"],
  9. "routes":
  10. [
  11. {
  12. "handle": [{
  13. "handler": "forward_proxy",
  14. "hide_ip": true,
  15. "hide_via": true,
  16. "auth_user_deprecated": "$uuid",
  17. "auth_pass_deprecated": "$uuid",
  18. "probe_resistance": {"domain": "$uuid.com"},
  19. "upstream": "socks5://$uuid:$uuid@127.0.0.1:59876"
  20. }]
  21. },
  22. {
  23. "handle": [{
  24. "handler": "subroute",
  25. "routes": [
  26. {
  27. "match": [{"path": ["/$vlessh2path"]}],
  28. "handle": [{
  29. "handler": "reverse_proxy",
  30. "transport": {
  31. "protocol": "http",
  32. "keep_alive": {
  33. "enabled": false
  34. },
  35. "versions": ["h2c"]
  36. },
  37. "upstreams": [{
  38. "dial": "127.0.0.1:50001"
  39. }]
  40. }],
  41. "terminal": true
  42. },
  43. {
  44. "match": [{"path": ["/$vmessh2path"]}],
  45. "handle": [{
  46. "handler": "reverse_proxy",
  47. "transport": {
  48. "protocol": "http",
  49. "keep_alive": {
  50. "enabled": false
  51. },
  52. "versions": ["h2c"]
  53. },
  54. "upstreams": [{
  55. "dial": "127.0.0.1:50002"
  56. }]
  57. }],
  58. "terminal": true
  59. }
  60. ]
  61. }]
  62. },
  63. {
  64. "handle": [{
  65. "handler": "file_server",
  66. "root": "/usr/share/caddy"
  67. }],
  68. "terminal": true
  69. }
  70. ],
  71. "allow_h2c": true
  72. }
  73. }
  74. }
  75. }
  76. }