Skip to content

fix(nginx): Add default server block for welcome page #102

Merged
nfebe merged 2 commits intomainfrom
fix/nginx-default-server
Mar 24, 2026
Merged

fix(nginx): Add default server block for welcome page #102
nfebe merged 2 commits intomainfrom
fix/nginx-default-server

Conversation

@nfebe
Copy link
Copy Markdown
Contributor

@nfebe nfebe commented Mar 24, 2026

No description provided.

nfebe added 2 commits March 24, 2026 01:36
The nginx template had no server block in conf.d/, so port 80 returned
connection reset on fresh installs. Added default.conf serving the
welcome page from /usr/share/nginx/html.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
Signed-off-by: nfebe <fenn25.fn@gmail.com>
@sourceant
Copy link
Copy Markdown

sourceant bot commented Mar 24, 2026

Code Review Summary

This PR introduces a default Nginx server configuration to serve a welcome page. It includes the configuration file, metadata registration, and updates the Go embed directives to include the new file.

🚀 Key Improvements

  • Added templates/infra/nginx/default.conf to handle catch-all requests.
  • Updated templates/templates.go to include the new config in the binary via go:embed.

💡 Minor Suggestions

  • Improve fallback handling in try_files to redirect to index.html instead of a hard 404 for a better 'Welcome' page experience.

Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

index index.html;

location / {
try_files $uri $uri/ =404;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When serving a static welcome page in a containerized or template-based environment, it is often better to fall back to index.html for SPAs or simply serve the index rather than returning a 404 if the exact URI is missing. However, if this is strictly for a static landing page, changing =404 to /index.html can improve user experience for trailing slash mismatches.

Suggested change
try_files $uri $uri/ =404;
+ try_files $uri $uri/ /index.html;

@nfebe nfebe merged commit 274e581 into main Mar 24, 2026
5 checks passed
@nfebe nfebe deleted the fix/nginx-default-server branch March 24, 2026 00:51
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.

1 participant