# Nginx config for Hermes Web Chat
# Save to /etc/nginx/sites-available/hermes-dashboard
# Then: ln -sf /etc/nginx/sites-available/hermes-dashboard /etc/nginx/sites-enabled/
#       nginx -t && nginx -s reload

server {
    listen 80;
    server_name _;

    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;

    location / {
        proxy_pass http://127.0.0.1:8888;
        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_read_timeout 120;
    }
}

# Optional: HTTPS with self-signed cert (Chrome will show warning)
# server {
#     listen 443 ssl;
#     server_name _;
#     ssl_certificate /etc/nginx/hermes.crt;
#     ssl_certificate_key /etc/nginx/hermes.key;
#     ssl_protocols TLSv1.2 TLSv1.3;
#     location / {
#         proxy_pass http://127.0.0.1:8888;
#         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_read_timeout 120;
#     }
# }
