85 lines
2.9 KiB
Plaintext
85 lines
2.9 KiB
Plaintext
# Copie este arquivo para /home/docker/docker/nginx/sites/ no host
|
|
# cloud-lua-net (ex: 30-atlas.conf) — é lido pelo container "nginx"
|
|
# (o proxy reverso principal, com HTTP/3), que monta
|
|
# ./docker/nginx/sites:/etc/nginx/conf.d.
|
|
#
|
|
# Pré-requisitos:
|
|
# 1. DNS de atlas.martinsevieira.adv.br apontando para este servidor.
|
|
# 2. O stack do Atlas (docker-compose.yml deste projeto) rodando e
|
|
# conectado à rede externa "dockernet" com IP fixo 10.15.0.93
|
|
# (ajuste os dois lugares abaixo se você mudou ANATOMIA_WEB_IP).
|
|
# 3. O container "anatomia-web" tem LETSENCRYPT_HOST=atlas.martinsevieira.adv.br,
|
|
# então o acme-companion já existente vai emitir o certificado
|
|
# automaticamente assim que este vhost estiver no ar respondendo o
|
|
# desafio HTTP-01 em /.well-known/acme-challenge/.
|
|
|
|
server {
|
|
server_name atlas.martinsevieira.adv.br;
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
auth_basic off;
|
|
auth_request off;
|
|
allow all;
|
|
root /usr/share/nginx/html;
|
|
try_files $uri =404;
|
|
break;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
server_name atlas.martinsevieira.adv.br;
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
# Sem "reuseport" aqui: já foi declarado uma única vez pelo primeiro
|
|
# vhost do host (12-sites.conf) para 0.0.0.0:443/[::]:443 — repetir
|
|
# causa "duplicate listen options" no nginx -t.
|
|
listen 443 quic;
|
|
listen [::]:443 quic;
|
|
http2 on;
|
|
http3 on;
|
|
http3_hq on;
|
|
quic_retry on;
|
|
quic_gso on;
|
|
|
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
|
|
ssl_certificate /etc/nginx/certs/atlas.martinsevieira.adv.br/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/atlas.martinsevieira.adv.br/key.pem;
|
|
ssl_dhparam /etc/nginx/certs/dhparam.pem;
|
|
|
|
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
|
resolver_timeout 5s;
|
|
|
|
ssl_protocols TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_timeout 10m;
|
|
ssl_session_tickets off;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
|
|
# Modelos 3D (.glb) podem crescer bastante quando o dataset for
|
|
# ampliado com malhas reais do BodyParts3D/Z-Anatomy.
|
|
client_max_body_size 200m;
|
|
|
|
# anatomia-web (o nginx interno do app) já cuida do SPA fallback e do
|
|
# proxy para /api e /models até o backend — aqui é só um passthrough.
|
|
location / {
|
|
proxy_pass http://10.15.0.93:80;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
}
|