Fix backend deployment configuration
- Add psycopg2-binary for PostgreSQL database driver - Update nginx config for HTTP-only access on IP address
This commit is contained in:
parent
3c513594ba
commit
3c3da50a54
@ -10,3 +10,4 @@ python-jose[cryptography]==3.3.0
|
|||||||
bcrypt==4.2.0
|
bcrypt==4.2.0
|
||||||
python-multipart==0.0.6
|
python-multipart==0.0.6
|
||||||
psycopg[binary]==3.2.3
|
psycopg[binary]==3.2.3
|
||||||
|
psycopg2-binary==2.9.9
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# HTTP redirect to HTTPS
|
# HTTP server (no SSL for IP-based access)
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
@ -9,41 +9,6 @@ server {
|
|||||||
root /var/www/certbot;
|
root /var/www/certbot;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirect all other traffic to HTTPS
|
|
||||||
location / {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# HTTPS server
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
# SSL certificates (will be created by certbot)
|
|
||||||
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
|
|
||||||
|
|
||||||
# SSL configuration
|
|
||||||
ssl_session_timeout 1d;
|
|
||||||
ssl_session_cache shared:SSL:50m;
|
|
||||||
ssl_session_tickets off;
|
|
||||||
|
|
||||||
# Modern SSL configuration
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
|
||||||
ssl_prefer_server_ciphers off;
|
|
||||||
|
|
||||||
# HSTS
|
|
||||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
|
||||||
|
|
||||||
# Security headers
|
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
||||||
add_header X-Content-Type-Options "nosniff" always;
|
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
||||||
|
|
||||||
# Auth endpoints with rate limiting
|
# Auth endpoints with rate limiting
|
||||||
location ~ ^/auth/(login|register)$ {
|
location ~ ^/auth/(login|register)$ {
|
||||||
limit_req zone=auth_limit burst=10 nodelay;
|
limit_req zone=auth_limit burst=10 nodelay;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user