Skip to content

Angular AppEngine i18 redirect includes full domain #29514

Closed

Description

@jmbarbier

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

While serving a i18n using AngularNodeAppEngine, the base path i18n redirect uses the full URL to do the 302 redirect to i18n subpaths.

https://github.com/angular/angular-cli/blob/main/packages/angular/ssr/src/app-engine.ts#L120

If the application is not served directly on the real domain (ex: using a cdn or cloud run), the redirect issued is redirecting to the bad domain.

browser : example.com  ----> cdn/reverse proxy  ---> app.cloud.run.domain
                                                                |
                                                           redirect 302 to
   browser            <----------------------------  app.cloud.run.domain/de/
       |                                                         
handle redirect       ------------------------------> app.cloud.run.domain/de/

Only redirecting to /de/ path instead of full url should be enough.

Minimal Reproduction

Create a ssr i18n app
Host it on google cloud run (url : app.cloud.run.domain)
Point to it using any cdn/reverse proxy (url: example.com)
Navigate to naked domain example.com
Browser is redirected to app.cloud.run.domain/de

Exception or Error


Your Environment

Angular CLI: 19.1.4
Node: 22.6.0
Package Manager: npm 10.8.2
OS: linux x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.4
@angular-devkit/build-angular   19.1.4
@angular-devkit/core            19.1.4
@angular-devkit/schematics      19.1.4
@angular/cli                    19.1.4
@angular/ssr                    19.1.4
@schematics/angular             19.1.4
rxjs                            7.8.1
typescript                      5.7.3

Anything else relevant?

No response

Activity

  1. self-assigned this
    on Jan 29, 2025
  2. added
    freq1: low
    on Jan 29, 2025
  3. added 2 commits that reference this issue on Jan 29, 2025
    1ac7e46
    8c8822c
  4. added 2 commits that reference this issue on Jan 29, 2025
    46581db
    747557a
  5. angular-automatic-lock-bot commented on Mar 1, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/ssrfreq1: lowseverity3: brokentype: bug/fix

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions