aws-amplify / aws-amplify/amplify-hosting

Remove default Rewrites and redirects rules for Nuxt SSR

Open
#3,829 3 comments 4 reactions 0 assignees View on GitHub
pending-triage
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

d1cs14y4x3ieze

### AWS Region

ap-southeast-1

### Amplify Hosting feature

Redirects, SSR

### Frontend framework

Vue

### Next.js version

Nuxt Version: 3.8.2

### Next.js router

N/A

### Describe the bug

Amplify has these Rewrites and redirects settings by default.
Screenshot 2023-11-26 at 17 40 13

However, it's not working for a Nuxt SSR app, because nuxt build does not create any `index.html` file, it will keep redirecting to `/index.html` for every routes.

### Expected behavior

These settings should not be set by default for Nuxt SRR applications.

### Reproduction steps

1. Init a Nuxt 3 repo.
2. Create some pages, for example: `/login`
3. Deploy to Amplify (https://aws.amazon.com/blogs/mobile/introducing-support-for-hosting-any-ssr-app-on-aws-amplify-hosting/)
4. Visit the login page `main..amplifyapp.com/login`

It redirect to `/index.html`, since this file does not exist it will show 404 error.

### Build Settings

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

No repository files, tests, or entry points are named. Start by reproducing the Nuxt 3.8.2 SSR deployment and inspecting the default Amplify Hosting Rewrites and redirects settings; done means a Nuxt SSR route such as /login no longer redirects to /index.html and loads successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, nuxt
Domain
cloud, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.