Skip to content

Custom paths not effective #671

@morningstart-liu

Description

@morningstart-liu

Hi,
I tested paths functionality by referring to the profile of paths.md. But didn't get the result that I wanted, and then I got the runtime configuration (http://127.0.0.1:8484/trickster/config) and I didn't see the configuration that I had customized, so, can you see where the problem is, thanks you .

version: Trickster version: 2.0.0-beta2 (linux/amd64)

my config.yaml

request_rewriters:
  example_rewriter:
    instructions:
      - [ 'header', 'set', 'Req', 'www.test.com1111' ]
      - [ 'hostname', 'set', 'www.test.com' ]
      
frontend:
  listen_port: 8480
#  listen_address: ''
#  tls_listen_address: ''
#  tls_listen_port: 0
#  0 by default, unlimited.
#  connections_limit: 0

caches:
  default:
    provider: filesystem
    index:
#     reap_interval_ms defines how long the Cache Index reaper sleeps between reap cycles. Default is 3 (3s)
      reap_interval_ms: 3000
#     flush_interval_ms sets how often the Cache Index saves its metadata to the cache from application memory. Default is 5 (5s)
      flush_interval_ms: 5000
#     max_size_bytes indicates how large the cache can grow in bytes before the Index evicts least-recently-accessed items. default is 512MB
      max_size_bytes: 536870912
#     max_size_backoff_bytes indicates how far below max_size_bytes the cache size must be to complete a byte-size-based eviction exercise. default is 16MB
      max_size_backoff_bytes: 16777216
#     max_size_objects indicates how large the cache can grow in objects before the Index evicts least-recently-accessed items. default is 0 (infinite)
      max_size_objects: 0
#     max_size_backoff_objects indicates how far under max_size_objects the cache size must be to complete object-size-based eviction exercise. default is 100
      max_size_backoff_objects: 100
    filesystem:
#     cache_path defines the directory location under which the Trickster cache will be maintained
#     default is /tmp/trickster
      cache_path: /data/trickster
      
backends:
  default:
    req_rewriter_name: example_rewriter
    origin_url: http://www.test.com:8089
    provider: reverseproxy # use 'reverseproxy' for no caching  reverseproxycache
    path_routing_disabled: true
    cache_name: default
    is_default: true
    hosts: [ www.test.com ]
    max_object_size_bytes: 524288
    max_ttl_ms: 300000
    cache_key_prefix: test-prefix
    tracing_name: default
    healthcheck:
      verb: HEAD
      interval_ms: 10000
      path: /aaaa
      expected_codes: [ 200, 204, 206, 301, 302, 304, 404]
      failure_threshold: 2
      recovery_threshold: 2
    paths:
      server-status:
        path: /server-status/
        methods: [ GET, POST ]
        handler: proxycache
        match_type: prefix
        response_headers:
          Cache-Control: no-cache
          '-X-Server-IP': ''
          '-X-Server-Code': ''
          '-X-Cache-Detail': ''
          '-X-First-Read-Time': ''
          '-X-First-Read-Time': ''
          '-X-First-Connect-Time': ''
        request_headers:
          Host: www.test.com
      root:
        path: /xxx/
        methods: [ GET, POST, PUT ]
        handler: proxycache
        match_type: prefix 
        response_headers:
          Cache-Control: s-maxage=300
          '-Expires': ''
        request_headers:
          Host: www.test.com
          CDN: 1111111
      depot:
        path: /depot/
        methods: [ GET, POST, PUT ]
        handler: proxycache
        match_type: prefix 
        response_headers:
          Cache-Control: s-maxage=300
          '-Expires': ''
        request_headers:
          Host: www.test.com
          Connection: ''
          X-Forwarded-For: 127.0.0.1



    
metrics:
  listen_port: 8481   # available for scraping at http://<trickster>:<metrics.listen_port>/metrics

logging:
  log_level: debug
  log_file: ./trickster.log


tracing:
  default:
    provider: stdout
    service_name: trickster
    collector_url: http://jaeger:14268/api/traces
    sample_rate: 1.0
    tags:
      key1: "value1"
      key2: "value2"
    jaeger:
      endpoint_type: collector    
    stdout:
      pretty_print: false

metrics:
  listen_port: 8481
  listen_address: ''
 

runtime configuration just about paths :

    paths:
      /-1111111111:
        path: /
        match_type: prefix
        handler: proxy
        methods:
        - GET
        - HEAD
        - POST
        - PUT
        - DELETE
        - CONNECT
        - OPTIONS
        - TRACE
        - PATCH
        - PURGE
        no_metrics: false
        reqrewriter: []

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions