Skip to content

Commit 7288eb2

Browse files
authored
Merge pull request #2049 from Websoft9/update-trafficserver-e54fbe18
Update trafficserver
2 parents 8cb590f + b8a23a6 commit 7288eb2

File tree

11 files changed

+30
-269
lines changed

11 files changed

+30
-269
lines changed

apps/trafficserver/.env

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ W9_DIST=community
33
W9_VERSION="latest"
44

55
W9_POWER_PASSWORD="1PrMxExC45LsCT"
6-
7-
W9_HTTP_PORT_SET=8080
6+
W9_HTTP_PORT_SET='8080'
87
W9_HTTP_PORT=8080
9-
W9_ID=trafficserver
10-
W9_LOGIN_USER=admin
11-
W9_ADMIN_PATH="/manager"
12-
W9_URL=internet_ip:$W9_HTTP_PORT_SET
8+
W9_ID='trafficserver'
9+
W9_URL='internet_ip:$W9_HTTP_PORT_SET'
1310

1411
W9_NETWORK=websoft9
15-
16-
#### ----------------------------------------------------------------------------------------- ####
17-
18-
19-
# Below environment is created by this app
20-
# TrafficServer management configuration
21-
TS_ADMIN_USER=$W9_LOGIN_USER
22-
TS_ADMIN_PASSWORD=$W9_POWER_PASSWORD

apps/trafficserver/CHANGELOG.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
# CHANGELOG
22

3-
## 2025-12-25
4-
### Initial Release
5-
- Complete docker-compose orchestration for Apache Traffic Server
6-
- Basic reverse proxy configuration with records.config and remap.config
7-
- Health checks and proper resource limits
8-
- Persistent volumes for configuration, logs, and cache
9-
- Management interface on port 8088
10-
- Support for both HTTP (8080) and HTTPS (8443) protocols
11-
- Comprehensive documentation and troubleshooting guide
12-
13-
### Configuration
14-
- Default cache: 10GB disk, 256MB RAM
15-
- Resource limits: 4GB memory, 2 CPU cores
16-
- Reverse proxy mode enabled by default
17-
- Logging enabled with rotation
3+
## Release
4+
### Fixes and Enhancements
185

apps/trafficserver/Notes.md

Lines changed: 8 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,10 @@
1-
# Apache Traffic Server
1+
# Traffic Server
22

3-
## Notes
3+
1. 修改records.yaml以及remap.config
4+
remap.config示例:将所有发到该容器的请求反向代理到wordpress容器的80端口
5+
```
6+
map / http://wdpress_nmxmp/
7+
```
8+
2. 重建应用
49

5-
- Default HTTP port: 8080
6-
- Default HTTPS port: 8443
7-
- Management interface: 8088
8-
- Configuration files are mounted from `./src/` directory
9-
- Cache storage is persistent across container restarts
10-
11-
## Configuration Notes
12-
13-
1. **Reverse Proxy Setup**: Edit `src/remap.config` to configure backend server mappings
14-
2. **Performance Tuning**: Modify `src/records.config` for cache size and connection limits
15-
3. **SSL Configuration**: Place SSL certificates in the appropriate volume mount if needed
16-
17-
## Troubleshooting
18-
19-
### Common Issues
20-
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
29-
30-
### Logs
31-
32-
- Access logs: `/var/log/trafficserver/access.log`
33-
- Error logs: `/var/log/trafficserver/error.log`
34-
- Manager logs: `/var/log/trafficserver/manager.log`
35-
36-
## FAQ
37-
38-
### Q: How to configure TrafficServer as a reverse proxy?
39-
A: Edit the `src/remap.config` file and add mapping rules like:
40-
```
41-
map http://your-domain.com/ http://backend-server:port/
42-
```
43-
44-
### Q: How to increase cache size?
45-
A: Modify the following lines in `src/records.config`:
46-
```
47-
CONFIG proxy.config.cache.ram_cache.size INT 268435456 # RAM cache in bytes
48-
CONFIG proxy.config.cache.disk_space INT 10737418240 # Disk cache in bytes
49-
```
50-
51-
### Q: How to enable HTTPS?
52-
A: Configure SSL certificates and update the SSL settings in `records.config`
53-
54-
### Q: How to monitor TrafficServer?
55-
A: Use the management interface at `http://your-server:8088/` or check the log files
10+
配置文档:https://docs.trafficserver.apache.org/getting-started/index.en.html#configuration

apps/trafficserver/README.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Apache Traffic Server on Docker
22

3-
This is an **[Docker Compose template](https://github.com/Websoft9/docker-library)** powered by [Websoft9](https://www.websoft9.com) based on Docker for Apache Traffic Server.
3+
This is an **[Docker Compose template](https://github.com/Websoft9/docker-library)** powered by [Websoft9](https://www.websoft9.com) based on Docker for Apache Traffic Server:
44

5-
Apache Traffic Server is a high-performance HTTP proxy cache server that can be used as a reverse proxy, forward proxy, or cache server.
65

7-
## Supported Versions
6+
- community: latest
87

9-
- community: latest
108

119
## System Requirements
1210

@@ -23,27 +21,6 @@ You can install this Apache Traffic Server by [How to use it?](https://github.co
2321

2422
If you want use Apache Traffic Server with **Websoft9 Business Support** free, you can [subscribe Apache Traffic Server](https://www.websoft9.com/apps) on Cloud platform
2523

26-
## Quick Start
27-
28-
1. After installation, access the web interface:
29-
- HTTP: `http://your-server-ip:8080`
30-
- HTTPS: `https://your-server-ip:8443`
31-
- Management: `http://your-server-ip:8088`
32-
33-
2. Configure reverse proxy by editing the `remap.config` file in the `src` directory
34-
3. Restart the container to apply configuration changes
35-
36-
## Configuration
37-
38-
### Basic Configuration
39-
- Edit `src/records.config` for server settings
40-
- Edit `src/remap.config` for URL remapping rules
41-
42-
### Environment Variables
43-
- `W9_HTTP_PORT_SET`: HTTP port (default: 8080)
44-
- `W9_HTTPS_PORT_SET`: HTTPS port (default: 8443)
45-
- `W9_POWER_PASSWORD`: Admin password
46-
4724
## Documentation
4825

4926
[Apache Traffic Server Administrator Guide](https://support.websoft9.com/docs/trafficserver) powered by Websoft9

apps/trafficserver/docker-compose.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,9 @@ services:
1616
- trafficserver_config:/etc/trafficserver
1717
- trafficserver_logs:/var/log/trafficserver
1818
- trafficserver_cache:/var/cache/trafficserver
19-
- ./src/records.config:/etc/trafficserver/records.config:ro
20-
- ./src/records.yaml:/etc/trafficserver/records.yaml:ro
21-
- ./src/remap.config:/etc/trafficserver/remap.config:ro
22-
- ./src/hosting.config:/etc/trafficserver/hosting.config:ro
23-
environment:
24-
- TS_ROOT_PASSWORD=$W9_POWER_PASSWORD
25-
# Health check
26-
healthcheck:
27-
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
28-
interval: 30s
29-
timeout: 10s
30-
retries: 3
31-
start_period: 40s
19+
- ./src/records.yaml:/opt/etc/trafficserver/records.yaml
20+
- ./src/remap.config:/opt/etc/trafficserver/remap.config
21+
- ./src/storage.config:/opt/etc/trafficserver/storage.config
3222

3323
volumes:
3424
trafficserver_config:
@@ -38,4 +28,4 @@ volumes:
3828
networks:
3929
default:
4030
name: $W9_NETWORK
41-
external: true
31+
external: true

apps/trafficserver/src/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
# About
22

33
This folder includes files mount to container and used by Websoft9
4-
5-
## Configuration Files
6-
7-
- `records.config`: Traditional configuration file for Apache Traffic Server
8-
- `records.yaml`: Modern YAML configuration file (preferred by newer versions)
9-
- `remap.config`: URL remapping rules for reverse proxy configuration
10-
- `hosting.config`: Origin server configuration
11-
12-
## Usage
13-
14-
1. Edit `remap.config` to configure your reverse proxy mappings
15-
2. Modify `records.config` for performance and caching settings
16-
3. Restart the container to apply changes
17-
18-
## Default Configuration
19-
20-
- HTTP Port: 8080
21-
- HTTPS Port: 8443
22-
- Management Port: 8088
23-
- Cache Size: 10GB disk, 256MB RAM
24-
25-
Refer to [Apache Traffic Server Documentation](https://docs.trafficserver.apache.org/) for more configuration options.

apps/trafficserver/src/hosting.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/trafficserver/src/records.config

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,10 @@
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
1+
records:
2+
http:
223
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
4+
http: 1
5+
server_ports: 8080 8080:ipv6
6+
reverse_proxy:
7+
enabled: 1
8+
url_remap:
9+
pristine_host_hdr: 1
10+
remap_required: 1
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
1-
# Apache Traffic Server remap.config
2-
# Reverse proxy mapping configuration
3-
4-
# Default mapping - replace with your actual backend servers
5-
# Format: map <client-URL> <server-URL>
6-
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/
11-
12-
# Map any IP address on port 8080 to httpbin
13-
regex_map http://.*:8080/(.*) http://httpbin.org/$1
14-
15-
# HTTPS mapping (if needed)
16-
# map https://0.0.0.0:8443/ https://httpbin.org/
17-
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/
1+
map / http://wdpress_nmxmp/

0 commit comments

Comments
 (0)