# git.aegisone.ru -> Gitea
server {
    listen 80;
    server_name git.aegisone.ru;

    location /.well-known/acme-challenge/ {
        root /usr/share/nginx/html;
    }

    client_max_body_size 50M;

    location / {
        proxy_pass http://localhost:3000;
        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;
    }
}

server {
    listen 443 ssl;
    http2 on;
    server_name git.aegisone.ru;

    ssl_certificate /etc/nginx/certs/live/aegisone.ru.selfsigned/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/live/aegisone.ru.selfsigned/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    client_max_body_size 50M;

    location / {
        proxy_pass http://localhost:3000;
        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;
    }
}
