aws-amplify / aws-amplify/amplify-hosting

Rewrite for URL gives 502

Open
#2,035 8 comments 0 reactions 0 assignees View on GitHub
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-console/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-console/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-console/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

d3bsnv6aob3na2

### Region

us-west-2

### Amplify Console feature

Redirects

### Describe the bug

When creating a rewrite rule It will not work for rewriting from an ec2 instances DNS. Here is an example.

```
Source: /login
Target: https://staging.example.com/login
Type: 200 (Rewrite)
```

This currently gives a 502 Error on the page. I have tested with redirect instead of rewrite and that works, but it is necessary that I use the rewrite.

### Expected behavior

When using the rewrite that it uses the source URL, but goes to the target address given.

### Reproduction steps

Add rule to rewrite URL
example of this:
```Source: /
Target: https://someurl.url.com/
Type: 200 (rewrite)```

### Build Settings

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

No source files or tests are identified in the issue. Reproduce the rewrite rule in Amplify Hosting in us-west-2 using an EC2 DNS target, then compare it with the working redirect behavior. Done means the 200 rewrite serves the target without returning a 502.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.