-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
56 lines (45 loc) · 1.7 KB
/
nginx.conf
File metadata and controls
56 lines (45 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Servidor para el desafío HTTP-01 de Let's Encrypt
server {
listen 80;
server_name outfitlab.com.ar www.outfitlab.com.ar;
resolver 127.0.0.11 ipv6=off valid=30s;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# Redirigir todo el demás tráfico a HTTPS
location / {
return 301 https://$host$request_uri;
}
}
# Servidor principal para HTTPS
server {
listen 443 ssl;
server_name outfitlab.com.ar www.outfitlab.com.ar;
resolver 127.0.0.11 ipv6=off valid=30s;
# Rutas a los certificados (generados por Certbot)
ssl_certificate /etc/letsencrypt/live/outfitlab.com.ar/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/outfitlab.com.ar/privkey.pem;
# Configuraciones de seguridad SSL (básicas)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Archivos opcionales de Let's Encrypt (comentados porque no están disponibles en el contenedor)
# include /etc/letsencrypt/options-ssl-nginx.conf;
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Sirve el frontend
location / {
proxy_pass http://frontend_app;
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;
}
# Redirige las llamadas a la API al backend
location /api/ {
proxy_pass http://backend_app:8080;
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;
}
}