Compare commits

...

2 Commits

Author SHA1 Message Date
ske087
8dbcec974e docs: Replace specific domain with generic placeholder
- Changed qr.moto-adv.com to [your-domain] throughout documentation
- Made documentation more generic and reusable for any deployment
- Updated Nginx configuration examples with placeholder domain
- Standardized domain references in all configuration sections
2025-07-16 17:57:06 -04:00
ske087
7e28c3f365 docs: Add Nginx reverse proxy configuration guide
- Added comprehensive Nginx Proxy Manager setup instructions
- Documented HTTPS to HTTP routing requirements
- Included common proxy issues and troubleshooting
- Added standard Nginx configuration examples
- Clarified SSL termination at proxy level
2025-07-16 17:53:45 -04:00

View File

@@ -290,7 +290,7 @@ The application is fully containerized with Docker:
SECRET_KEY=your-super-secret-key-here
ADMIN_USERNAME=your-admin-username
ADMIN_PASSWORD=your-secure-password
APP_DOMAIN=qr.moto-adv.com # Your custom domain for URL shortener
APP_DOMAIN=[your-domain] # Your custom domain for URL shortener
```
2. **Deploy:**
@@ -303,10 +303,95 @@ The application is fully containerized with Docker:
The URL shortener feature uses the `APP_DOMAIN` environment variable to generate short URLs:
- **Development**: `APP_DOMAIN=localhost:5000`
- **Production**: `APP_DOMAIN=qr.moto-adv.com` or `APP_DOMAIN=https://qr.moto-adv.com`
- **Production**: `APP_DOMAIN=[your-domain]` or `APP_DOMAIN=https://[your-domain]`
Short URLs will be available at: `https://[your-domain]/s/[short-code]`
## 🌐 Reverse Proxy Configuration (Nginx)
When deploying behind a reverse proxy like Nginx Proxy Manager or standard Nginx, configure the proxy to route **HTTPS traffic to HTTP backend**:
### ⚠️ Important Proxy Configuration
- **Frontend (Public)**: HTTPS (Port 443)
- **Backend (Docker)**: HTTP (Port 8066)
- **SSL Termination**: At the proxy level
### Nginx Proxy Manager Setup
1. **Create Proxy Host**:
- Domain: `[your-domain]` (your domain)
- Forward Hostname/IP: `your-server-ip`
- Forward Port: `8066`
- **Protocol**: HTTP (not HTTPS)
2. **SSL Configuration**:
- Enable SSL certificate (Let's Encrypt)
- Force SSL: Yes
- HTTP/2 Support: Yes
3. **Advanced Settings** (if needed):
```nginx
# Custom Nginx configuration
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
```
### Standard Nginx Configuration
```nginx
server {
listen 443 ssl http2;
server_name [your-domain];
# SSL Configuration
ssl_certificate /path/to/ssl/cert.pem;
ssl_certificate_key /path/to/ssl/private.key;
# Proxy to Docker container
location / {
proxy_pass http://localhost:8066; # Note: HTTP, not HTTPS
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
# Redirect HTTP to HTTPS
server {
listen 80;
server_name [your-domain];
return 301 https://$server_name$request_uri;
}
```
### Common Proxy Issues & Solutions
| Issue | Cause | Solution |
|-------|-------|----------|
| 502 Bad Gateway | HTTPS→HTTPS routing | Change backend to HTTP |
| SSL errors | Missing certificates | Configure SSL at proxy level |
| 404 on subpaths | Missing headers | Add proxy headers |
| Session issues | Domain mismatch | Set correct `APP_DOMAIN` |
### Docker Configuration for Proxy
Ensure your `docker-compose.yml` exposes the correct port:
```yaml
services:
qr-manager:
ports:
- "8066:5000" # Maps container port 5000 to host port 8066
environment:
- APP_DOMAIN=[your-domain] # Your public domain
```
## 📱 Usage
### Generating QR Codes
@@ -335,7 +420,7 @@ Short URLs will be available at: `https://[your-domain]/s/[short-code]`
**Examples:**
- Original: `https://very-long-domain.com/extremely/long/path/to/resource`
- Short: `https://qr.moto-adv.com/s/abc123`
- Short: `https://[your-domain]/s/abc123`
## 🛡️ Security Features