
server {
    # Listen on port 443 (HTTPS) with SSL enabled
    listen 443 ssl;
    server_name qa-bex.corenroll.com;  # Replace with your actual domain
    
    # SSL certificate configuration with updated paths
    ssl_certificate /etc/ssl/c123/combined.pem;  # This file exists
    ssl_certificate_key /etc/ssl/c123/corenroll.key;  # Using the .pem file you have as the key
    
    # Recommended SSL settings
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;


    # Root directory for static files (if needed)
    root /var/www/enrollment-sites-ui/bex-ui/dist;
    index index.html;

    #
    location / {

        try_files $uri /index.html
          
      # Bypass cache
        add_header Cache-Control "no-cache, no-store, must-revalidate";
        add_header Pragma "no-cache";
        add_header Expires 0;

}    
    
    # Log configuration
    access_log /var/log/nginx/qa-bex.access.log;
    error_log /var/log/nginx/qa-bex.com.error.log;
}

# Redirect HTTP to HTTPS
server {
    listen 80;
    
    server_name qa-bex.corenroll.com;
    # Redirect all HTTP requests to HTTPS
    return 301 https://$host$request_uri;
}