|
| 1 | +# HTTP to HTTPS redirect for refreshwifi.com |
| 2 | +server { |
| 3 | + listen 80; |
| 4 | + listen [::]:80; |
| 5 | + server_name refreshwifi.com www.refreshwifi.com; |
| 6 | + return 301 https://refreshwifi.com$request_uri; |
| 7 | +} |
| 8 | + |
| 9 | +# Redirect www to refreshwifi.com |
| 10 | +server { |
| 11 | + listen 443 ssl http2; |
| 12 | + listen [::]:443 ssl http2; |
| 13 | + server_name www.refreshwifi.com; |
| 14 | + |
| 15 | + ssl_certificate /etc/letsencrypt/live/refreshwifi.com/fullchain.pem; |
| 16 | + ssl_certificate_key /etc/letsencrypt/live/refreshwifi.com/privkey.pem; |
| 17 | + |
| 18 | + return 301 https://refreshwifi.com$request_uri; |
| 19 | +} |
| 20 | + |
| 21 | +# Main server block for refreshwifi.com |
| 22 | +server { |
| 23 | + listen 443 ssl http2; |
| 24 | + listen [::]:443 ssl http2; |
| 25 | + server_name refreshwifi.com; |
| 26 | + |
| 27 | + # SSL Configuration |
| 28 | + ssl_certificate /etc/letsencrypt/live/refreshwifi.com/fullchain.pem; |
| 29 | + ssl_certificate_key /etc/letsencrypt/live/refreshwifi.com/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' https: data: blob:; script-src 'self' https://client.crisp.chat https://*.crisp.chat 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://client.crisp.chat https://*.crisp.chat wss://client.crisp.chat wss://*.crisp.chat; img-src 'self' https://image.crisp.chat https://client.crisp.chat data: blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://client.crisp.chat; font-src 'self' https://fonts.gstatic.com https://client.crisp.chat data:; frame-src https://client.crisp.chat https://*.crisp.chat;" 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