Skip to content

🐛(nginx) add page reconciliation on nginx#2154

Merged
AntoLC merged 2 commits intomainfrom
fix/conf-ngnix-page-reconciliation
Mar 31, 2026
Merged

🐛(nginx) add page reconciliation on nginx#2154
AntoLC merged 2 commits intomainfrom
fix/conf-ngnix-page-reconciliation

Conversation

@AntoLC
Copy link
Copy Markdown
Collaborator

@AntoLC AntoLC commented Mar 30, 2026

Purpose

The nginx conf was lacking the page reconciliation.
It is necessary to have it in place to avoid 404 errors when refreshing the page or accessing a page directly.
It is a known issue when using the Next Router in "export" mode, as it relies on client-side routing.

@AntoLC AntoLC self-assigned this Mar 30, 2026
@github-actions
Copy link
Copy Markdown

🚀 Preview will be available at https://2154-docs.ppr-docs.beta.numerique.gouv.fr/

You can use the existing account with these credentials:

  • username: docs
  • password: docs

You can also create a new account if you want to.

Once this Pull Request is merged, the preview will be destroyed.

@AntoLC AntoLC force-pushed the fix/conf-ngnix-page-reconciliation branch from a3a6201 to 76b8fff Compare March 30, 2026 14:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4f258f8-fdc4-4e3e-81c2-2bb443a0a911

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request adds a new nginx-frontend service to the Docker Compose setup to serve the impress frontend application. Changes include: adding an nginx-frontend service to compose.yml configured with port 3000, volume mounts for frontend configuration and built assets, and a dependency on the keycloak service; creating a new Make target to simplify service startup; adding an Nginx location block configuration to handle user-reconciliation routes with a fallback to the index.html file; and documenting the fix in the changelog.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding page reconciliation configuration to nginx to fix a specific issue (#2154).
Description check ✅ Passed The description is clearly related to the changeset, explaining the purpose of adding nginx page reconciliation to prevent 404 errors with Next Router.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/conf-ngnix-page-reconciliation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 217-219: The nginx-frontend Make target currently starts the
service without verifying the exported frontend artifacts; update the
nginx-frontend target to perform a preflight check that verifies the mount
directory (src/frontend/apps/impress/out) exists and is non-empty and fail fast
(exit non-zero with a clear error message) before invoking $(COMPOSE) up
--force-recreate -d nginx-frontend, and also fix the target help/comment to
indicate it will build/start only when the export files are present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 997b65cb-46e1-40f7-8b93-23d1072f1a19

📥 Commits

Reviewing files that changed from the base of the PR and between f166e75 and 76b8fff.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • Makefile
  • compose.yml
  • src/frontend/apps/impress/conf/default.conf

Comment on lines +217 to +219
nginx-frontend: ## build the nginx-frontend container
@$(COMPOSE) up --force-recreate -d nginx-frontend
.PHONY: nginx-frontend
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

nginx-frontend can start without build artifacts, causing misleading 404s.

Line 218 starts the service directly, but it depends on src/frontend/apps/impress/out being present (mounted in compose.yml, Line 138). Add a preflight check (and fix the help text) so this target fails fast when export files are missing.

💡 Proposed fix
-nginx-frontend: ## build the nginx-frontend container
+nginx-frontend: ## start nginx-frontend with exported static frontend
+	`@test` -f $(PATH_FRONT_IMPRESS)/out/index.html || ( \
+		echo "Missing $(PATH_FRONT_IMPRESS)/out/index.html. Run 'cd $(PATH_FRONT_IMPRESS) && yarn build' first."; \
+		exit 1 \
+	)
 	@$(COMPOSE) up --force-recreate -d nginx-frontend
 .PHONY: nginx-frontend
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
nginx-frontend: ## build the nginx-frontend container
@$(COMPOSE) up --force-recreate -d nginx-frontend
.PHONY: nginx-frontend
nginx-frontend: ## start nginx-frontend with exported static frontend
`@test` -f $(PATH_FRONT_IMPRESS)/out/index.html || ( \
echo "Missing $(PATH_FRONT_IMPRESS)/out/index.html. Run 'cd $(PATH_FRONT_IMPRESS) && yarn build' first."; \
exit 1 \
)
@$(COMPOSE) up --force-recreate -d nginx-frontend
.PHONY: nginx-frontend
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 217 - 219, The nginx-frontend Make target currently
starts the service without verifying the exported frontend artifacts; update the
nginx-frontend target to perform a preflight check that verifies the mount
directory (src/frontend/apps/impress/out) exists and is non-empty and fail fast
(exit non-zero with a clear error message) before invoking $(COMPOSE) up
--force-recreate -d nginx-frontend, and also fix the target help/comment to
indicate it will build/start only when the export files are present.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

Size Change: 0 B

Total Size: 4.25 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/620b0145/_buildManifest.js 622 B +622 B (new file) 🆕
apps/impress/out/_next/static/8192fe45/_buildManifest.js 0 B -622 B (removed) 🏆

compressed-size-action

@AntoLC AntoLC requested a review from lunika March 31, 2026 10:26
AntoLC added 2 commits March 31, 2026 16:14
The nginx conf was lacking the page reconciliation.
It is necessary to have it in place to avoid
404 errors when refreshing the page or accessing
a page directly.
It is a known issue when using the Next Router
in "export" mode, as it relies on client-side routing.
To test easily a build application with nginx,
we add a nginx-frontend to serve the static files
of the application, it will help us to test the
application in a more production-like environment.
@AntoLC AntoLC force-pushed the fix/conf-ngnix-page-reconciliation branch from 76b8fff to cd882c8 Compare March 31, 2026 14:15
@AntoLC AntoLC merged commit cd882c8 into main Mar 31, 2026
27 of 28 checks passed
@AntoLC AntoLC deleted the fix/conf-ngnix-page-reconciliation branch March 31, 2026 14:33
lunika added a commit that referenced this pull request Apr 2, 2026
Added

- 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec
- 🥚(frontend) add easter egg on doc emoji creation #2155

Changed

- ♿(frontend) use aria-haspopup menu on DropButton triggers #2126
- ♿️(frontend) add contextual browser tab titles for docs routes #2120
- ♿️(frontend) fix empty heading before section titles in HTML export #2125

Fixed

- ⚡️(frontend) add jitter to WS reconnection #2162
- 🐛(frontend) fix tree pagination #2145
- 🐛(nginx) add page reconciliation on nginx #2154
@lunika lunika mentioned this pull request Apr 2, 2026
AntoLC pushed a commit that referenced this pull request Apr 3, 2026
Added

- 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec
- 🥚(frontend) add easter egg on doc emoji creation #2155

Changed

- ♿(frontend) use aria-haspopup menu on DropButton triggers #2126
- ♿️(frontend) add contextual browser tab titles for docs routes #2120
- ♿️(frontend) fix empty heading before section titles in HTML export #2125

Fixed

- ⚡️(frontend) add jitter to WS reconnection #2162
- 🐛(frontend) fix tree pagination #2145
- 🐛(nginx) add page reconciliation on nginx #2154
AntoLC pushed a commit that referenced this pull request Apr 3, 2026
Added

- 🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control usage of docspec
- 🥚(frontend) add easter egg on doc emoji creation #2155

Changed

- ♿(frontend) use aria-haspopup menu on DropButton triggers #2126
- ♿️(frontend) add contextual browser tab titles for docs routes #2120
- ♿️(frontend) fix empty heading before section titles in HTML export #2125

Fixed

- ⚡️(frontend) add jitter to WS reconnection #2162
- 🐛(frontend) fix tree pagination #2145
- 🐛(nginx) add page reconciliation on nginx #2154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants