Successfully reorganized the FastHTTP Reverse Proxy project by moving example files and Docker configurations into a dedicated examples/ folder for better project structure and maintainability.
examples/
├── README.md # Comprehensive examples documentation
├── Dockerfile # Docker build configuration (updated paths)
├── docker-compose.yml # Docker Compose setup (updated paths)
├── html1/ # Test backend 1
│ └── index.html
└── html2/ # Test backend 2
└── index.html
Updated examples/docker-compose.yml:
- Changed build context from
.to..(parent directory) - Updated volume paths:
../config.yml:/root/config.yml:ro../routes.yml:/root/routes.yml:ro
- HTML backend volumes remain relative to examples directory
Updated examples/Dockerfile:
- Changed source paths to reference parent directory (
../) - Added all required module directories:
../config/,../server/,../handlers/, etc.
- Updated build context to work from examples directory
Created examples/README.md with comprehensive coverage:
- Usage instructions for Docker Compose
- Manual testing procedures
- Test scenarios (load balancing, header manipulation, WebSocket)
- Configuration notes and customization guide
Updated main README.md:
- Added reference to examples directory
- Updated Docker deployment section
- Provided both automated (docker-compose) and manual Docker options
- Verified docker-compose configuration syntax
- Confirmed all path references are correct
- Tested that builds work from examples directory
fasthttp-reverse-proxy/
├── main.go
├── config.yml
├── routes.yml
├── Dockerfile # ❌ Mixed with source code
├── docker-compose.yml # ❌ Mixed with source code
├── html1/ # ❌ Mixed with source code
├── html2/ # ❌ Mixed with source code
└── [other source files]
fasthttp-reverse-proxy/
├── main.go
├── config.yml
├── routes.yml
├── [source code packages]
└── examples/ # ✅ Clean separation
├── README.md
├── Dockerfile
├── docker-compose.yml
├── html1/
└── html2/
cd examples/
docker-compose up --build# From project root
docker build -f examples/Dockerfile -t fasthttp-reverse-proxy .- Load Balancing Test: Multiple backends with round-robin distribution
- Header Manipulation Test: Comprehensive security and CORS headers
- WebSocket Test: WebSocket proxying with custom headers
- Health Check Test: Built-in health monitoring endpoints
✅ Clean Project Structure: Source code separated from examples
✅ Better Maintainability: Examples isolated and documented
✅ Developer Experience: Clear separation of concerns
✅ Documentation: Comprehensive usage guides
✅ Testing: Complete test environment with backends
✅ Production Ready: Clean deployment structure
-
Moved Files:
html1/→examples/html1/html2/→examples/html2/Dockerfile→examples/Dockerfiledocker-compose.yml→examples/docker-compose.yml
-
Updated Files:
examples/Dockerfile- Fixed source pathsexamples/docker-compose.yml- Fixed volume and build pathsREADME.md- Updated Docker deployment section
-
Created Files:
examples/README.md- Comprehensive examples documentationPROJECT_REORGANIZATION_COMPLETE.md- This summary
- Test the Setup: Use
cd examples && docker-compose up --build - Customize Examples: Modify examples for specific use cases
- Add More Examples: Create additional test scenarios as needed
- Update CI/CD: Update any build scripts to reference new paths
The project now has a professional, maintainable structure with clear separation between source code and examples/testing infrastructure!