Files
AyposWeb/nginx.conf
2025-07-25 01:08:06 +00:00

37 lines
1.2 KiB
Nginx Configuration File

server {
listen 80;
server_name aypos.blc-css.com; # Replace with your domain or IP
root /usr/share/nginx/html; # Path to your built files
index index.html;
# Serve static files directly
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://aypos-api.blc-css.com:8003/; # Proxy to your API subdomain
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Optional: Add gzip compression for better performance
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Optional: Add security headers (adjust as needed)
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
# Optional: Cache static assets aggressively
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
try_files $uri =404;
}
}