Skip to content

Angular URL Rewrite #4266

Closed
Closed
@themac13

Description

@themac13

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):

Yes

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):

URL rewrite?


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

NGINX Ingress controller version: 0.24.1

Kubernetes version (use kubectl version): v1.13.5

Environment: AKS

  • Cloud provider or hardware configuration: AKS
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

Angular application:

`apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
namespace: ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
spec:
tls:

  • hosts:
    • dev.dev.com
      secretName: cert
      rules:
  • host: dev.dev.com
    http:
    paths:
    • path: /merchant(/|$)(.*)
      backend:
      serviceName: service
      servicePort: 80`

Calling the url dev.dev.com/merchant shows a blank page. In console, it says:

GET https://dev.dev.com/runtime.js net::ERR_ABORTED 404

What you expected to happen:
It should be loading resources from

htts://dev.dev.com/merchant/runtime.js

To make it work. (Can confirm if accessing that URL directly it will load the JS and other resources that's 404-ing)

Any resources from the deployment should stay in the /merchant/* rather than load at /

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions