SSL/TLS Configuration
Application URL
Always use HTTPS in production:.env
Force HTTPS
The Panel automatically enforces HTTPS whenAPP_URL uses https://. Ensure your web server (Nginx/Apache) is configured to redirect HTTP to HTTPS.
Trusted Proxies
What are Trusted Proxies?
When the Panel runs behind a reverse proxy (Cloudflare, load balancer, etc.), the Panel sees the proxy’s IP address instead of the client’s. Configuring trusted proxies allows the Panel to read the real client IP from proxy headers.Configuration
.env
string
Comma-separated list of trusted proxy IP addresses or CIDR ranges.Special values:
*- Trust the directly connected proxy only**- Trust all proxies in the chain192.168.1.1,10.0.0.0/8- Specific IPs or CIDR ranges
Common Configurations
Verifying Proxy Configuration
Check if the Panel sees the correct client IP:Session Security
Session Configuration
.env
string
default:"redis"
Session storage driver. Use
redis or database in production, never file.integer
default:"720"
Session lifetime in minutes (12 hours by default).
boolean
default:"true"
Encrypt session data before storage.
boolean
Only send session cookies over HTTPS. Auto-detected from
APP_URL if not set.boolean
default:"true"
Prevent JavaScript from accessing session cookies.
string
default:"lax"
SameSite cookie attribute. Options:
lax- Balanced security (recommended)strict- Maximum security, may break some workflowsnone- Allow cross-site requests (requiressecureflag)
Session Cookie Configuration
.env
string
Session cookie name. Auto-generated from
APP_NAME if not set.string
Cookie domain. Leave empty to use the current domain.
Set to
.example.com (with leading dot) to share sessions across subdomains.string
default:"/"
Cookie path. Usually should remain
/.Encryption Key Management
Application Key
.env
APP_KEY is used to encrypt:
- Session data
- Cookies
- Database encrypted fields
- Signed URLs
Generating a New Key
Key Rotation
To rotate the encryption key without breaking existing data:-
Add the current key to
APP_PREVIOUS_KEYS:.env -
Generate a new key:
- Laravel will attempt to decrypt data with old keys if the current key fails.
Debug Mode
.env
boolean
default:"false"
Enable detailed error messages and stack traces.
Safe Error Reporting
For production error tracking, use error monitoring services:.env
Password Security
The Panel uses bcrypt for password hashing. No additional configuration needed.Password Requirements
Password requirements are enforced at the application level:- Minimum 8 characters
- No maximum length
- No character requirements (allowing passphrases)
Two-Factor Authentication
Encourage users to enable 2FA:- User account → Security → Two-Factor Authentication
- Scan QR code with authenticator app
- Enter verification code
Security Headers
Configure security headers in your web server:Header Explanations
X-Content-Type-Options
X-Content-Type-Options
Prevents browsers from MIME-sniffing responses away from the declared content-type.
X-Content-Type-Options: nosniffX-Frame-Options
X-Frame-Options
Prevents clickjacking attacks by controlling whether the page can be embedded in frames.
X-Frame-Options: SAMEORIGIN - Allow framing only from the same origin.X-XSS-Protection
X-XSS-Protection
Enables browser’s XSS filtering (legacy, but still useful for older browsers).
X-XSS-Protection: 1; mode=blockReferrer-Policy
Referrer-Policy
Controls how much referrer information is included with requests.
Referrer-Policy: same-origin - Only send referrer for same-origin requests.Content-Security-Policy
Content-Security-Policy
Controls which resources the browser is allowed to load, preventing XSS and injection attacks.
The Panel requires
unsafe-inline and unsafe-eval for JavaScript functionality.Strict-Transport-Security (HSTS)
Strict-Transport-Security (HSTS)
Forces browsers to only use HTTPS connections.
Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadFirewall Configuration
Required Ports
Only expose necessary ports to the internet:UFW Firewall
File Permissions
Proper file permissions prevent unauthorized access:Security Checklist
1
Use HTTPS
Configure SSL/TLS with a valid certificate (Let’s Encrypt recommended).
2
Disable Debug Mode
Set
APP_DEBUG=false in production.3
Secure Environment File
Set
.env permissions to 600 and never commit to version control.4
Configure Trusted Proxies
Set
TRUSTED_PROXIES if behind a reverse proxy or CDN.5
Enable Session Security
Verify
SESSION_ENCRYPT, SESSION_SECURE_COOKIE, and SESSION_HTTP_ONLY are enabled.6
Secure Database Access
Use strong passwords and restrict access to localhost or private network.
7
Secure Redis
Set
REDIS_PASSWORD and bind to localhost.8
Configure Firewall
Only expose ports 80 and 443 to the public internet.
9
Set File Permissions
Follow the principle of least privilege for file permissions.
10
Enable 2FA
Enable two-factor authentication for all administrator accounts.
11
Regular Updates
Keep the Panel, PHP, and system packages up to date.
12
Monitor Logs
Regularly review logs for suspicious activity:
Additional Resources
Let's Encrypt SSL
Free SSL/TLS certificates with automatic renewal.
Mozilla SSL Config
Generate secure SSL configurations for your web server.
Security Headers
Test your site’s security headers.
SSL Labs Test
Test your SSL/TLS configuration.
