Files
crm.clientright.ru/crm_extensions/file_storage/crm.clientright.ru.conf.NEW
Fedor 9245768987 🚀 CRM Files Migration & Real-time Features
 Features:
- Migrated ALL files to new S3 structure (Projects, Contacts, Accounts, HelpDesk, Invoice, etc.)
- Added Nextcloud folder buttons to ALL modules
- Fixed Nextcloud editor integration
- WebSocket server for real-time updates
- Redis Pub/Sub integration
- File path manager for organized storage
- Redis caching for performance (Functions.php)

📁 New Structure:
Documents/Project/ProjectName_ID/file_docID.ext
Documents/Contacts/FirstName_LastName_ID/file_docID.ext
Documents/Accounts/AccountName_ID/file_docID.ext

🔧 Technical:
- FilePathManager for standardized paths
- S3StorageService integration
- WebSocket server (Node.js + Docker)
- Redis cache for getBasicModuleInfo()
- Predis library for Redis connectivity

📝 Scripts:
- Migration scripts for all modules
- Test pages for WebSocket/SSE/Polling
- Documentation (MIGRATION_*.md, REDIS_*.md)

🎯 Result: 15,000+ files migrated successfully!
2025-10-24 19:59:28 +03:00

118 lines
4.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
server_name crm.clientright.ru www.crm.clientright.ru ;
listen 147.45.146.17:443 ssl ;
listen [2a03:6f00:a::bc9]:443 ssl ;
ssl_certificate "/var/www/httpd-cert/crm.clientright.ru_2024-03-31-12-42_40.crt";
ssl_certificate_key "/var/www/httpd-cert/crm.clientright.ru_2024-03-31-12-42_40.key";
charset utf-8;
gzip on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/css text/xml application/javascript text/plain application/json image/svg+xml image/x-icon;
gzip_comp_level 1;
set $root_path /var/www/fastuser/data/www/crm.clientright.ru;
root $root_path;
disable_symlinks if_not_owner from=$root_path;
# WebSocket для CRM файловой синхронизации
location /ws {
proxy_pass http://127.0.0.1:3001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
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;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_buffering off;
proxy_cache_bypass $http_upgrade;
}
# SSE endpoint для синхронизации файлов с Redis
location ~ ^/crm_extensions/file_storage/api/(sse_events|redis_sse)\.php$ {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
# КРИТИЧЕСКИ ВАЖНО для SSE!
proxy_buffering off; # Отключаем буферизацию
proxy_cache off; # Отключаем кеш
proxy_set_header Connection ''; # HTTP/1.1 keep-alive
# Таймауты для длительных соединений (1 час)
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
# Заголовки
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;
# HTTP/1.1 для chunked transfer encoding
proxy_http_version 1.1;
# NGINX не должен добавлять свои заголовки
add_header X-Accel-Buffering no;
}
# Long polling endpoint
location ~ ^/crm_extensions/file_storage/api/long_poll_events\.php$ {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
# Отключаем буферизацию для long polling
proxy_buffering off;
proxy_cache off;
# Увеличенные таймауты (30 секунд для long polling)
proxy_connect_timeout 35s;
proxy_send_timeout 35s;
proxy_read_timeout 35s;
include /etc/nginx/proxy_params;
}
location / {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
include /etc/nginx/proxy_params;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico|7z|doc|docx|map|ogg|otf|pdf|tff|tif|txt|wav|webp|woff|woff2|xls|xlsx|xml)$ {
try_files $uri $uri/ @fallback;
}
location @fallback {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
include /etc/nginx/proxy_params;
}
include "/etc/nginx/fastpanel2-sites/fastuser/crm.clientright.ru.includes";
include /etc/nginx/fastpanel2-includes/*.conf;
error_log /var/www/fastuser/data/logs/crm.clientright.ru-frontend.error.log;
access_log /var/www/fastuser/data/logs/crm.clientright.ru-frontend.access.log;
}
server {
server_name crm.clientright.ru www.crm.clientright.ru ;
listen 147.45.146.17:80;
listen [2a03:6f00:a::bc9]:80;
return 301 https://$host$request_uri;
error_log /var/www/fastuser/data/logs/crm.clientright.ru-frontend.error.log;
access_log /var/www/fastuser/data/logs/crm.clientright.ru-frontend.access.log;
}