# Example only: adapt paths, certificates, limits, and PHP-FPM socket to your server.
server {
    listen 443 ssl http2;
    server_name api.example.com;
    root /var/www/gsmx/api/public;
    index index.php;
    # Configure ssl_certificate / ssl_certificate_key using your certificate manager.
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Content-Type-Options nosniff always;
    client_max_body_size 1m;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    }
    location ~ /\.(?!well-known) { deny all; }
}
