semaphoreui / semaphore

Modern UI for Ansible, Terraform, OpenTofu, Bash, Pulumi.

Home Page:https://semaphoreui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem: Runner console not updating with NGINX reverse proxy

ljvdhooft opened this issue · comments

Issue

When using an NGINX reverse proxy, the console isn't updated unless hard refreshed.

Steps to reproduce:

  • Create a Docker compose with the Semaphore service and an NGINX service (using the compose from the documentation and adding the following service:
  nginx:
    image: nginx
    ports:
      - "80:80"
      - "443:443"

With a self signed certificate and the following NGINX config template, based on the one from the documentation:

server {
  listen 443 ssl;
  server_name  _;

  # add Strict-Transport-Security to prevent man in the middle attacks
  add_header Strict-Transport-Security "max-age=31536000" always;

  # SSL
  ssl_certificate /etc/nginx/cert/cert.pem;
  ssl_certificate_key /etc/nginx/cert/privkey.pem;

  # Recommendations from 
  # https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
  ssl_protocols TLSv1.1 TLSv1.2;
  ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:10m;

  # required to avoid HTTP 411: see Issue #1486 
  # (https://github.com/docker/docker/issues/1486)
  chunked_transfer_encoding on;

  location / {
    proxy_pass http://semaphore:3000/;
    proxy_set_header Host $http_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;

    proxy_buffering off;
    proxy_request_buffering off;
  }

  location /api/ws {
    proxy_pass http://semaphore:3000/api/ws;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Origin "";
  }
}
  • Leave port 3000 mapped on the sempahore service.
  • Start the compose
  • Start a semaphore run
  • Compare the realtime console output on port 443 and port 3000

The result is that the console log is updated realtime on port 3000 (plain httpd server), but not on port 443 (nginx reverse proxy server).

Is there an nginx config setting that needs to be put in place in order to have the console log in realtime?

Impact

Web-Frontend (what users interact with)

Installation method

Docker

Database

MySQL

Browser

Chrome

Semaphore Version

v2.9.75 and latest

Ansible Version

No response

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

No response

wasn't able to reproduce this myself lol