feat: nginx wildcard static site server for *.auraajenticai.cloud
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
FROM nginx:alpine
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
VOLUME ["/sites"]
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
+37
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user