| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- server {
- server_name radionica3d.me 148.230.71.134;
- root /var/www/radionica3d/dist;
- index index.html;
- # Gzip Compression
- gzip on;
- gzip_static on;
- gzip_vary on;
- gzip_proxied any;
- gzip_comp_level 6;
- gzip_buffers 16 8k;
- gzip_http_version 1.1;
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml font/woff2;
- # Security Headers
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Content-Type-Options "nosniff";
- add_header Referrer-Policy "strict-origin-when-cross-origin";
- # add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
- location / {
- try_files $uri $uri/ /index.html;
-
- # Caching for index.html (don't cache)
- location = /index.html {
- add_header Cache-Control "no-store, no-cache, must-revalidate";
- }
- }
- # Static assets in /assets/ (Vite)
- location /assets/ {
- expires 1y;
- add_header Cache-Control "public, immutable";
- access_log off;
- }
- # Font files (local hosting, long-term cache)
- location /fonts/ {
- expires 10y;
- add_header Cache-Control "public, immutable";
- access_log off;
- }
- # Other static files
- location ~* \.(?:ico|gif|jpe?g|png|svg|webp|avif)$ {
- expires 7d;
- add_header Cache-Control "public";
- access_log off;
- }
- # Proxy API requests to backend
- location /api/ {
- proxy_pass http://127.0.0.1:8000/;
- 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;
- }
- # Standalone Deploy Webhook
- location /deploy-webhook {
- proxy_pass http://127.0.0.1:9000;
- proxy_set_header Host $host;
- }
- # WebSocket requests
- location /ws/ {
- proxy_pass http://127.0.0.1:8000/;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header Host $host;
- proxy_read_timeout 86400;
- }
- # Static uploads
- location /uploads/ {
- alias /var/www/radionica3d/backend/uploads/;
- expires 30d;
- add_header Cache-Control "public";
- }
- listen 443 ssl; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/radionica3d.me/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/radionica3d.me/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
- }
- server {
- if ($host = radionica3d.me) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- listen 80;
- server_name radionica3d.me;
- return 301 https://radionica3d.me$request_uri;
- }
|