1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

cha2524222fvd

This commit is contained in:
MoonTestUse1
2024-12-24 02:55:24 +06:00
parent e8002afdc9
commit e0ae5f0fab
2 changed files with 22 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
# Upstream backend servers
upstream backend {
server backend:8080; # Changed from 8000 to 8080 to match FastAPI port
keepalive 32;
}
# Main server configuration
server { server {
listen 80; listen 80;
server_name localhost; server_name localhost;
@@ -14,7 +21,9 @@ server {
# Backend API proxy # Backend API proxy
location /api/ { location /api/ {
proxy_pass http://backend:8000/api/; proxy_pass http://backend/api/; # Added /api/ to ensure proper path rewriting
# Proxy headers
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade'; proxy_set_header Connection 'upgrade';
@@ -29,4 +38,10 @@ server {
proxy_send_timeout 60s; proxy_send_timeout 60s;
proxy_read_timeout 60s; proxy_read_timeout 60s;
} }
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
} }

View File

@@ -8,11 +8,16 @@ events {
} }
http { http {
include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status '
'$body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
} }