Add Nginx test configurations, HTTP scripts for self-serve APIs, and .env example; update .gitignore for IntelliJ files and logs.

- Introduced `PemToCoseConversionTest` for WebAuthn key testing.
- Added example Nginx config (`nginx-example.conf`) with CORS and PHP handling.
- Created HTTP test scripts for self-serve API endpoints.
- Provided `.env` example for Elastic Stack credentials.
- Updated `.gitignore` to include IntelliJ and Nginx logs.
This commit is contained in:
Jeppe Bundgaard
2026-02-24 11:44:09 +01:00
parent ba9f6b7d01
commit 76496fc403
7 changed files with 160 additions and 8 deletions
+68
View File
@@ -0,0 +1,68 @@
# Main Nginx Configuration File
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Include additional configuration files
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Log settings
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Gzip settings (optional)
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
# Include server block configurations
include /etc/nginx/conf.d/*.conf;
# Localhost without SSL
server {
listen [::]:80 default_server;
listen 80 default_server;
root /var/www/html;
index index.html index.htm index.php;
# Logging
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log combined;
# Add CORS headers
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Authorization, Content-Type, X-Requested-With, X-Customer-Number";
add_header Access-Control-Allow-Credentials true;
# If OPTIONS method is needed for preflight
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Authorization, Content-Type, X-Requested-With, X-Customer-Number";
return 204; # No Content
}
# Run the index.php file, no matter what the request URI is
try_files $uri $uri/ /index.php?$query_string;
}
# Location for PHP (using PHP 8.2)
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
# Location for static files
location ~* \.(cgi|shtml|phtml)$ {
}
}
}