Skip to content

Fix console 404 issue when accessing via domain_name - #255

Merged
jbonofre merged 1 commit into
apache:mainfrom
MonkeyCanCode:fix_console_404_issue_with_domain_name
Jul 27, 2026
Merged

Fix console 404 issue when accessing via domain_name#255
jbonofre merged 1 commit into
apache:mainfrom
MonkeyCanCode:fix_console_404_issue_with_domain_name

Conversation

@MonkeyCanCode

@MonkeyCanCode MonkeyCanCode commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR fix issue reported in #249.

So what happened here is we changed the console port number from original 80 (which caused issue in #231) to 4040 then changed to 8080 during recent helm re-work as suggested by the team (8080 for console, 8181 for polaris api, and 8182 for polaris metrics). However, this caused one issue when accessing console via domain name where end-users would be getting 404 for all endpoints. But this doesn't cause issue when accessing via localhost via port forwarding.

Now this is actually due to the incorrect way of how we are using the Nginx UBI image. Following is the snippet for default nginx.conf.

...
    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /opt/app-root/etc/nginx.d/*.conf;

    server {
        listen       8080 default_server;
        listen       [::]:8080 default_server;
        server_name  _;
        root         /opt/app-root/src;

        # Load configuration files for the default server block.
        include /opt/app-root/etc/nginx.default.d/*.conf;
    }
}
...

What the dockerfile was doing earlier was creating a new server section via include /opt/app-root/etc/nginx.d/*.conf;. This was not a problem when we are using non-8080 port as that new server section would captured all. However, as we are using port 8080 with server_name localhost, it will covered the usage when accesing via 8080. The problem comes when we are using domain as the newly added server section won't catch it anymore and it will fall into second (original) one which yield 404.

The fix in this PR is to ensure we only have one server running for nginx by inject our location blocks inside the UBI's existing default server.

Validation for both access via localhost as well as a dummy local domain:

dummy local domain:
image
localhost:
image

@jbonofre
jbonofre merged commit 8ffe1e5 into apache:main Jul 27, 2026
5 checks passed
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.

2 participants