commit 5a7d66865c047cfc80726969971ad0e9c251e251 Author: khondokartowsif171 Date: Mon May 25 20:19:11 2026 +0600 feat: nginx wildcard static site server for *.auraajenticai.cloud diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc4bdce --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:alpine +COPY nginx.conf /etc/nginx/nginx.conf +VOLUME ["/sites"] +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..fdcf86f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,37 @@ +worker_processes auto; +events { worker_connections 1024; } + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + gzip on; + gzip_types text/html text/css application/javascript application/json image/svg+xml text/plain; + + # Wildcard vhost — routes *.auraajenticai.cloud to /sites/{subdomain}/ + server { + listen 80 default_server; + listen [::]:80 default_server; + + # Extract subdomain from Host header + set $subdomain ""; + if ($host ~* ^([^.]+)\.auraajenticai\.cloud$) { + set $subdomain $1; + } + + # Reject if no subdomain resolved + if ($subdomain = "") { + return 444; + } + + root /sites/$subdomain; + index index.html; + + add_header X-Frame-Options SAMEORIGIN; + add_header X-Content-Type-Options nosniff; + + location / { + try_files $uri $uri/ /index.html =404; + } + } +}