fix db
This commit is contained in:
parent
71f72f6395
commit
48e588bb82
BIN
backend/.DS_Store
vendored
BIN
backend/.DS_Store
vendored
Binary file not shown.
BIN
backend/app/.DS_Store
vendored
BIN
backend/app/.DS_Store
vendored
Binary file not shown.
@ -12,7 +12,7 @@ from sqlalchemy.orm import Session
|
||||
from app.config import settings
|
||||
|
||||
# Настройка SQLAlchemy
|
||||
SQLALCHEMY_DATABASE_URL = settings.DATABASE_URL
|
||||
SQLALCHEMY_DATABASE_URL = "postgresql://gen_user:F%2BgEEiP3h7yB6d@93.183.81.86:5432/shop_db"
|
||||
|
||||
engine = create_engine(SQLALCHEMY_DATABASE_URL)
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
BIN
certbot/.DS_Store
vendored
Normal file
BIN
certbot/.DS_Store
vendored
Normal file
Binary file not shown.
@ -9,7 +9,7 @@ services:
|
||||
expose:
|
||||
- "8000"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/shop_db
|
||||
# - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/shop_db
|
||||
- DEBUG=0
|
||||
- SECRET_KEY=${SECRET_KEY:-supersecretkey}
|
||||
- UPLOAD_DIRECTORY=/app/uploads
|
||||
|
||||
BIN
frontend/.DS_Store
vendored
BIN
frontend/.DS_Store
vendored
Binary file not shown.
BIN
frontend/app/(main)/.DS_Store
vendored
BIN
frontend/app/(main)/.DS_Store
vendored
Binary file not shown.
BIN
frontend/app/.DS_Store
vendored
BIN
frontend/app/.DS_Store
vendored
Binary file not shown.
BIN
frontend/certbot/.DS_Store
vendored
Normal file
BIN
frontend/certbot/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
frontend/components/.DS_Store
vendored
BIN
frontend/components/.DS_Store
vendored
Binary file not shown.
@ -2,8 +2,33 @@ server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Размер загружаемых файлов
|
||||
# Настройка буферов для улучшения производительности
|
||||
client_body_buffer_size 128k;
|
||||
client_max_body_size 20M;
|
||||
client_body_timeout 60s;
|
||||
|
||||
# Буферизация для проксирования
|
||||
proxy_buffers 16 32k;
|
||||
proxy_buffer_size 64k;
|
||||
proxy_busy_buffers_size 128k;
|
||||
proxy_temp_file_write_size 256k;
|
||||
|
||||
# Настройка сжатия
|
||||
gzip on;
|
||||
gzip_comp_level 5;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
gzip_vary on;
|
||||
gzip_types
|
||||
application/javascript
|
||||
application/json
|
||||
application/xml
|
||||
application/xml+rss
|
||||
image/svg+xml
|
||||
text/css
|
||||
text/javascript
|
||||
text/plain
|
||||
text/xml;
|
||||
|
||||
# Frontend (Next.js)
|
||||
location / {
|
||||
@ -13,6 +38,9 @@ server {
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
}
|
||||
|
||||
# Backend API
|
||||
@ -23,6 +51,9 @@ server {
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
}
|
||||
|
||||
# Docs для API
|
||||
@ -53,11 +84,32 @@ server {
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# Статические файлы и загруженные изображения
|
||||
# Статические файлы и загруженные изображения
|
||||
location /uploads/ {
|
||||
alias /app/uploads/;
|
||||
|
||||
# Настройки кэширования для оптимизации загрузки
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
|
||||
# Настройки для эффективной отдачи статических файлов
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
sendfile on;
|
||||
sendfile_max_chunk 1m;
|
||||
|
||||
# Отключаем логирование для статики
|
||||
access_log off;
|
||||
|
||||
# Заголовки для изображений разных форматов
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|webp)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
add_header Pragma public;
|
||||
add_header Vary Accept-Encoding;
|
||||
access_log off;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,20 +22,51 @@ server {
|
||||
ssl_certificate_key /etc/letsencrypt/live/dressedforsuccess.shop/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/dressedforsuccess.shop/chain.pem;
|
||||
|
||||
# Настройки SSL
|
||||
# Оптимизация SSL
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384';
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
|
||||
# Размер загружаемых файлов
|
||||
# Настройка буферов для улучшения производительности
|
||||
client_body_buffer_size 128k;
|
||||
client_max_body_size 20M;
|
||||
client_body_timeout 60s;
|
||||
|
||||
# HSTS (предполагается использование сайта только через HTTPS)
|
||||
# Буферизация для проксирования
|
||||
proxy_buffers 16 32k;
|
||||
proxy_buffer_size 64k;
|
||||
proxy_busy_buffers_size 128k;
|
||||
proxy_temp_file_write_size 256k;
|
||||
|
||||
# Настройка сжатия
|
||||
gzip on;
|
||||
gzip_comp_level 5;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
gzip_vary on;
|
||||
gzip_types
|
||||
application/javascript
|
||||
application/json
|
||||
application/xml
|
||||
application/xml+rss
|
||||
image/svg+xml
|
||||
text/css
|
||||
text/javascript
|
||||
text/plain
|
||||
text/xml;
|
||||
|
||||
# Заголовки безопасности
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
# Frontend (Next.js)
|
||||
location / {
|
||||
@ -48,6 +79,9 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
}
|
||||
|
||||
# Backend API
|
||||
@ -61,6 +95,9 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
}
|
||||
|
||||
# Docs для API
|
||||
@ -103,9 +140,38 @@ server {
|
||||
# Статические файлы и загруженные изображения
|
||||
location /uploads/ {
|
||||
alias /app/uploads/;
|
||||
|
||||
# Настройки кэширования для оптимизации загрузки
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
|
||||
# Настройки для эффективной отдачи статических файлов
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
sendfile on;
|
||||
sendfile_max_chunk 1m;
|
||||
|
||||
# Отключаем логирование для статики
|
||||
access_log off;
|
||||
|
||||
# Настройки для изображений разных форматов
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|webp)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
add_header Pragma public;
|
||||
add_header Vary Accept-Encoding;
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
# Настройка для WebP - автоматическая подстановка WebP, если есть поддержка в браузере
|
||||
add_header Vary Accept;
|
||||
|
||||
# Включаем прямое чтение для статических файлов
|
||||
directio 512;
|
||||
directio_alignment 512;
|
||||
|
||||
# Отключаем логирование для изображений
|
||||
access_log off;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user