How to I support both and

Hi, I recently set up my kubernetes with ingress. I am able to access my REST through for example, however, if I try to access it via or doesn’t seem to reach the server (404).

How can I enable my server to be reachable by both and

Below is my ingress definition

apiVersion: extensions/v1beta1
kind: Ingress
  name: web-ingress
  annotations:  'nginx' "True"
  - host:
      - path: /
          serviceName: abc-web-service
          servicePort: 80
      - path: /api
          serviceName: abc-rest-service
          servicePort: 80

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you’re using Nginx, you could do something like the following within your Nginx config:

server {
  rewrite ^$request_uri? permanent;

Think different and code well,


Hi thank you for your reply!

I believe the domain is already set up to my droplet/server as I can access it via already. How would I go about redirecting any requests to “” to -> “” ?

Kind Regards Junio

Hello, @brancojunio

The first step will be to make sure that both and www.adc.dom DNS is pointed to your droplet/server. If that is already configured your can simply redirect www to non-www or vice versa.

Let me know if you have any questions.

Regards, Alex