Skip to content

fix(nginx): update backend configuration to use variables for optiona… - #134

Merged
pikann merged 2 commits into
masterfrom
fix/update-nginx-config
May 22, 2026
Merged

pikann merged 2 commits into
masterfrom
fix/update-nginx-config

Conversation

@pikann

@pikann pikann commented May 22, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the NGINX gateway configuration to improve flexibility and reliability when handling optional backend services. The changes remove static upstream blocks for services that may not always be running (such as web and minio) and instead use NGINX variables for dynamic backend resolution. This approach allows for more graceful startup and operation when optional services are unavailable.

Improvements to NGINX backend configuration:

  • Removed static upstream blocks for web and minio services, replacing them with NGINX variables to allow for conditional backend resolution and more graceful handling when these services are not running.
  • Updated the /storage/ location to use a variable ($minio_backend) for the MinIO backend address, instead of referencing a static upstream block.
  • Updated the root / location to use a variable ($web_backend) for the web backend address, instead of referencing a static upstream block.

@pikann
pikann requested a review from Copilot May 22, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the NGINX gateway routing for optional backend services by removing static upstream blocks for web and minio and switching those locations to variable-based proxy_pass targets, aiming to avoid startup failures when optional services are absent.

Changes:

  • Removed upstream web_backend and upstream minio_backend blocks.
  • Updated /storage/ to set $minio_backend ... and proxy_pass $minio_backend/.
  • Updated / to set $web_backend ... and proxy_pass $web_backend.
Comments suppressed due to low confidence (1)

deploy/nginx/gateway.conf:254

  • Same resolver issue as /storage/: $web_backend contains the hostname web, and variable-based proxy_pass needs an explicit resolver directive or requests will error at runtime. Please add a resolver at http/server scope (or use an upstream with resolve) so the name can be resolved dynamically.
    location / {
        set $web_backend http://web:3000;
        proxy_pass         $web_backend;
        proxy_http_version 1.1;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy/nginx/gateway.conf Resolved
Comment thread deploy/nginx/gateway.conf Resolved
@pikann
pikann merged commit 7848d56 into master May 22, 2026
@pikann
pikann deleted the fix/update-nginx-config branch May 22, 2026 10:37

Copilot AI commented May 22, 2026

Copy link
Copy Markdown
Contributor

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api
    • Triggering command: /usr/sbin/nginx nginx -t -c /tmp/paca-nginx-test.conf (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants