1+ # HTTP to HTTPS redirect for freshpass.today and freshpasstoday.com
2+ server {
3+ listen 80;
4+ listen [::]:80;
5+ server_name freshpass.today www.freshpass.today freshpasstoday.com www.freshpasstoday.com;
6+ return 301 https://freshpass.today$request_uri;
7+ }
8+
9+ # Redirect www and .com domains to freshpass.today
10+ server {
11+ listen 443 ssl http2;
12+ listen [::]:443 ssl http2;
13+ server_name www.freshpass.today freshpasstoday.com www.freshpasstoday.com;
14+
15+ ssl_certificate /etc/letsencrypt/live/freshpass.today/fullchain.pem;
16+ ssl_certificate_key /etc/letsencrypt/live/freshpass.today/privkey.pem;
17+
18+ return 301 https://freshpass.today$request_uri;
19+ }
20+
21+ # Main server block for freshpass.today
22+ server {
23+ listen 443 ssl http2;
24+ listen [::]:443 ssl http2;
25+ server_name freshpass.today;
26+
27+ # SSL Configuration
28+ ssl_certificate /etc/letsencrypt/live/freshpass.today/fullchain.pem;
29+ ssl_certificate_key /etc/letsencrypt/live/freshpass.today/privkey.pem;
30+ ssl_protocols TLSv1.2 TLSv1.3;
31+ ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384;
32+ ssl_prefer_server_ciphers off;
33+
34+ # Security headers
35+ add_header X-Frame-Options "SAMEORIGIN" always;
36+ add_header X-XSS-Protection "1; mode=block" always;
37+ add_header X-Content-Type-Options "nosniff" always;
38+ add_header Referrer-Policy "no-referrer-when-downgrade" always;
39+ add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;" always;
40+
41+ # Document root
42+ root /var/www/freshpass;
43+ index index.html;
44+
45+ # Gzip compression
46+ gzip on;
47+ gzip_vary on;
48+ gzip_min_length 1024;
49+ gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
50+
51+ # Cache static assets
52+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
53+ expires 1y;
54+ add_header Cache-Control "public, immutable";
55+ }
56+
57+ # Main location
58+ location / {
59+ try_files $uri $uri/ $uri.html /index.html;
60+ }
61+
62+ # Error pages
63+ error_page 404 /404.html;
64+ error_page 500 502 503 504 /50x.html;
65+ }
0 commit comments