| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- 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;
- }
- # Other static files
- location ~* \.(?:ico|gif|jpe?g|png|woff2?|eot|otf|ttf|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;
- }
|