Skip to content

Commit a321fce

Browse files
committed
trafficserver
1 parent 53d40ec commit a321fce

File tree

7 files changed

+88
-14
lines changed

7 files changed

+88
-14
lines changed

apps/trafficserver/Notes.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818

1919
### Common Issues
2020

21-
1. **Container fails to start**: Check port conflicts (8080, 8443, 8088)
22-
2. **Configuration errors**: Validate syntax in `records.config` and `remap.config`
23-
3. **Permission issues**: Ensure proper file permissions for mounted configuration files
21+
1. **"Not Found on Accelerator" Error**:
22+
- Check that remap.config has correct mapping rules
23+
- Ensure the client URL matches the mapping pattern
24+
- Verify that the origin server in remap.config is accessible
25+
26+
2. **Container fails to start**: Check port conflicts (8080, 8443, 8088)
27+
3. **Configuration errors**: Validate syntax in `records.config`, `records.yaml` and `remap.config`
28+
4. **Permission issues**: Ensure proper file permissions for mounted configuration files
2429

2530
### Logs
2631

apps/trafficserver/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ services:
1717
- trafficserver_logs:/var/log/trafficserver
1818
- trafficserver_cache:/var/cache/trafficserver
1919
- ./src/records.config:/etc/trafficserver/records.config:ro
20+
- ./src/records.yaml:/etc/trafficserver/records.yaml:ro
2021
- ./src/remap.config:/etc/trafficserver/remap.config:ro
22+
- ./src/hosting.config:/etc/trafficserver/hosting.config:ro
2123
environment:
2224
- TS_ROOT_PASSWORD=$W9_POWER_PASSWORD
2325
# Health check

apps/trafficserver/src/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ This folder includes files mount to container and used by Websoft9
44

55
## Configuration Files
66

7-
- `records.config`: Main configuration file for Apache Traffic Server
7+
- `records.config`: Traditional configuration file for Apache Traffic Server
8+
- `records.yaml`: Modern YAML configuration file (preferred by newer versions)
89
- `remap.config`: URL remapping rules for reverse proxy configuration
10+
- `hosting.config`: Origin server configuration
911

1012
## Usage
1113

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# hosting.config
2+
# Origin server configuration
3+
# Format: hostname=origin_server:port [options]
4+
5+
# Default origin server for all requests
6+
hostname=* origin_server=httpbin.org:80

apps/trafficserver/src/records.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Basic configuration for reverse proxy setup
33

44
# HTTP server ports
5-
CONFIG proxy.config.http.server_ports STRING 8080 8443:ssl
5+
CONFIG proxy.config.http.server_ports STRING 8080:ipv4 8443:ssl:ipv4
66

77
# Cache settings
88
CONFIG proxy.config.cache.ram_cache.size INT 268435456 # 256MB
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Apache Traffic Server records.yaml
2+
# Modern YAML configuration for TrafficServer
3+
4+
# HTTP server configuration
5+
proxy:
6+
config:
7+
http:
8+
server_ports: "8080:ipv4 8443:ssl:ipv4"
9+
cache:
10+
http: 1
11+
ignore_client_cc_max_age: 1
12+
required_headers: 0
13+
keep_alive_enabled_in: 1
14+
keep_alive_enabled_out: 1
15+
chunking_enabled: 1
16+
server_session_sharing:
17+
match: both
18+
session_auth_cache:
19+
enabled: 1
20+
21+
# Cache settings
22+
cache:
23+
ram_cache:
24+
size: 268435456 # 256MB
25+
disk_space: 10737418240 # 10GB
26+
27+
# Reverse proxy mode
28+
reverse_proxy:
29+
enabled: 1
30+
31+
# Logging configuration
32+
log:
33+
logging_enabled: 3
34+
max_secs_per_buffer: 5
35+
max_space_mb_for_logs: 25000
36+
max_space_mb_headroom: 1000
37+
rolling_enabled: 1
38+
39+
# Management interface
40+
admin:
41+
synthetic_port: 8088
42+
autoconf_port: 8080
43+
44+
# SSL settings
45+
ssl:
46+
client:
47+
verify:
48+
server: 0
49+
server:
50+
cert:
51+
load_elevated: 1
52+
53+
# Performance tuning
54+
net:
55+
connections_throttle: 30000
56+
accept_threads: 1
57+
task_threads: 2

apps/trafficserver/src/remap.config

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
# Default mapping - replace with your actual backend servers
55
# Format: map <client-URL> <server-URL>
66

7-
# Example: Map all requests to a backend server
8-
# map http://localhost:8080/ http://backend-server:80/
7+
# Map all HTTP requests to httpbin for testing
8+
map http://0.0.0.0:8080/ http://httpbin.org/
9+
map http://localhost:8080/ http://httpbin.org/
10+
map http://127.0.0.1:8080/ http://httpbin.org/
911

10-
# Example: Map specific paths
11-
# map http://localhost:8080/api/ http://api-server:8080/
12-
# map http://localhost:8080/static/ http://static-server:80/
12+
# Map any IP address on port 8080 to httpbin
13+
regex_map http://.*:8080/(.*) http://httpbin.org/$1
1314

14-
# HTTPS mapping
15-
# map https://localhost:8443/ https://backend-server:443/
15+
# HTTPS mapping (if needed)
16+
# map https://0.0.0.0:8443/ https://httpbin.org/
1617

17-
# Default catch-all (redirect to a default page if needed)
18-
map / http://httpbin.org/
18+
# Example: Map specific paths
19+
# map http://localhost:8080/api/ http://api-server:8080/
20+
# map http://localhost:8080/static/ http://static-server:80/

0 commit comments

Comments
 (0)