server { listen 80; server_name nxtgauge.com www.nxtgauge.com; root /usr/share/nginx/html; index index.html; # Serve static assets with caching location /assets/ { expires 30d; add_header Cache-Control "public, immutable"; } # All requests serve the single page location / { try_files $uri $uri/ /index.html; } # Redirect www to non-www if ($host = www.nxtgauge.com) { return 301 https://nxtgauge.com$request_uri; } }