{"id":205383,"date":"2021-03-18T16:00:44","date_gmt":"2021-03-18T13:00:44","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/"},"modified":"2021-03-18T16:00:44","modified_gmt":"2021-03-18T13:00:44","slug":"how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/","title":{"rendered":"#How to Redirect to \u201cwww\u201d with Nginx Ingress \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6af5156072949\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6af5156072949\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Using_the_Annotation\" >Using the Annotation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Setting_up_Your_Hosts\" >Setting up Your Hosts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Adding_HTTPS_Support\" >Adding HTTPS Support<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Making_the_Domain_a_Variable\" >Making the Domain a Variable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Handling_Development_Environments\" >Handling Development Environments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-redirect-to-www-with-nginx-ingress-cloudsavvy-it\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Redirect to \u201cwww\u201d with Nginx Ingress \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9632\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/06268c7060f33c17d0b8db5f1f90faf9\/p\/uploads\/2021\/02\/748108a6.jpg\" alt=\"Graphic showing the Kubernetes logo\" width=\"1602\" height=\"902\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You\u2019ll often want to deploy a web <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lication to the root of your domain, as well as the \u201cwww\u201d subdomain. This helps users discover your service. Nginx Ingress has built-in support for the procedure.<\/p>\n<p>Here\u2019s how to deploy a workload with two ingress hosts, \u201cwww\u201d and your bare domain. Anyone visiting \u201cwww\u201d will proceed as normal. Visitors to the domain root will be redirected to the \u201cwww\u201d subdomain. By using a redirect, you reduce the risk that both endpoints could show in search results.<\/p>\n<h2 id=\"using-the-annotation\"><span class=\"ez-toc-section\" id=\"Using_the_Annotation\"><\/span>Using the Annotation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Nginx Ingress provides a Kubernetes annotation that lets you configure this behaviour. Adding the annotation to your Ingress resource enables the redirect infrastructure. You don\u2019t need to manually write the rewrite logic into your Nginx configuration.<\/p>\n<pre>nginx.ingress.kubernetes.io\/from-to-www-redirect: \"true\"<\/pre>\n<p>Set this annotation in the <code>metadata.annotations<\/code> field of your Ingress\u2019 resource definition. A complete working example is provided in the next section.<\/p>\n<h2 id=\"setting-up-your-hosts\"><span class=\"ez-toc-section\" id=\"Setting_up_Your_Hosts\"><\/span>Setting up Your Hosts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You should add your Ingress host configuration in the usual way. You only need <em>one<\/em> <code>host<\/code> line. Use the \u201cwww\u201d domain here \u2013 Nginx Ingress will automatically handle the redirect from the bare domain. If you prefer, you can write the bare domain instead. Nginx Ingress will then redirect <em>to<\/em> it, <em>from<\/em> <code>www<\/code>.<\/p>\n<p>Add the rest of the ingress configuration below the <code>host<\/code> line. You\u2019ll need to indicate the HTTP path to serve (usually <code>\/<\/code>) and the service to route traffic to.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>networking.k8s.io\/v1beta1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Ingress<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>my-ingress<span class=\"co3\">\n  namespace<\/span><span class=\"sy2\">: <\/span>my-namespace<span class=\"co4\">\n  annotations<\/span>:<span class=\"co3\">\n    kubernetes.io\/ingress.class<\/span><span class=\"sy2\">: <\/span>nginx-ingress<span class=\"co3\">\n    nginx.ingress.kubernetes.io\/from-to-www-redirect<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"true\"<\/span><span class=\"co4\">\nspec<\/span>:<span class=\"co4\">\n  rules<\/span>:<span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span>www.example.com<span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n        - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co4\">\n          backend<\/span>:<span class=\"co3\">\n            serviceName<\/span><span class=\"sy2\">: <\/span>my-service<span class=\"co3\">\n            servicePort<\/span><span class=\"sy2\">: <\/span>80<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This minimal working example should allow you to see the redirect in action. Visiting the bare domain will im<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">media<\/a>tely take you to \u201cwww\u201d instead. You can be sure users interact with your site via a single entrypoint, even though there\u2019s two possible ingress hosts.<\/p>\n<h2 id=\"adding-https-support\"><span class=\"ez-toc-section\" id=\"Adding_HTTPS_Support\"><\/span>Adding HTTPS Support<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The manifest shown above lacks support for HTTPS. In a real scenario, you\u2019ll almost certainly want to ensure all your ingress hosts are covered by a TLS certificate.<\/p>\n<p>Getting HTTPS working with this configuration requires you to add both your hosts to a single TLS certificate. Here\u2019s an updated manifest with TLS support:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>networking.k8s.io\/v1beta1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Ingress<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>my-ingress<span class=\"co3\">\n  namespace<\/span><span class=\"sy2\">: <\/span>my-namespace<span class=\"co4\">\n  annotations<\/span>:<span class=\"co3\">\n    kubernetes.io\/ingress.class<\/span><span class=\"sy2\">: <\/span>nginx-ingress<span class=\"co3\">\n    certmanager.k8s.io\/cluster-issuer<\/span><span class=\"sy2\">: <\/span>letsencrypt-prod<span class=\"co3\">\n    nginx.ingress.kubernetes.io\/from-to-www-redirect<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"true\"<\/span><span class=\"co4\">\nspec<\/span>:<span class=\"co4\">\n  rules<\/span>:<span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span>www.example.com<span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n        - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co4\">\n          backend<\/span>:<span class=\"co3\">\n            serviceName<\/span><span class=\"sy2\">: <\/span>my-service<span class=\"co3\">\n            servicePort<\/span><span class=\"sy2\">: <\/span>80<span class=\"co4\">\n  tls<\/span>:<span class=\"co4\">\n    - hosts<\/span><span class=\"sy2\">:\n<\/span>        - example.com\n        - www.example.com<span class=\"co3\">\n      secretName<\/span><span class=\"sy2\">: <\/span>ingress-tls-secret<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>With only five more lines of YAML, you should now have working HTTPS on both the possible ingress hosts. This assumes you\u2019re got an active certificate issuer in your cluster \u2013 we\u2019re using <code>letsencrypt-prod<\/code>, provided by <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/cert-manager.io\/docs\">cert-manager<\/a>. You should follow the documentation to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/cert-manager.io\/docs\/installation\">install cert-manager<\/a> if there\u2019s no certificate controller available.<\/p>\n<p>You can also choose an alternative certificate controller. You\u2019d need to update the <code>cluster-issuer<\/code> ingress annotation with the name of an issuer provided by your controller. You won\u2019t need to change the <code>tls<\/code> section of the manifest \u2013 this will work with all Kubernetes certificate controllers.<\/p>\n<h2 id=\"making-the-domain-a-variable\"><span class=\"ez-toc-section\" id=\"Making_the_Domain_a_Variable\"><\/span>Making the Domain a Variable<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can convert the manifest into a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/helm.sh\/\">Helm chart<\/a> to avoid having to repeat the domain name. In this example, we\u2019ll assume your domain name is set as <code>ingressDomain<\/code> in your Helm chart\u2019s <code>values.yaml<\/code>.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>networking.k8s.io\/v1beta1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Ingress<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>my-ingress<span class=\"co3\">\n  namespace<\/span><span class=\"sy2\">: <\/span>my-namespace<span class=\"co4\">\n  annotations<\/span>:<span class=\"co3\">\n    kubernetes.io\/ingress.class<\/span><span class=\"sy2\">: <\/span>nginx-ingress<span class=\"co3\">\n    certmanager.k8s.io\/cluster-issuer<\/span><span class=\"sy2\">: <\/span>letsencrypt-prod<span class=\"co3\">\n    nginx.ingress.kubernetes.io\/from-to-www-redirect<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"true\"<\/span><span class=\"co4\">\nspec<\/span>:<span class=\"co4\">\n  rules<\/span>:<span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span><span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print <span class=\"st0\">\"www.\"<\/span> .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n        - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co4\">\n          backend<\/span>:<span class=\"co3\">\n            serviceName<\/span><span class=\"sy2\">: <\/span>my-service<span class=\"co3\">\n            servicePort<\/span><span class=\"sy2\">: <\/span>80<span class=\"co4\">\n  tls<\/span>:<span class=\"co4\">\n    - hosts<\/span><span class=\"sy2\">:\n<\/span>        - <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n        - <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print <span class=\"st0\">\"www\"<\/span> .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co3\">\n      secretName<\/span><span class=\"sy2\">: <\/span>ingress-tls-secret<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>If you ever need to change your domain name, you\u2019ll now only have to update the value in one place. This also permits use of the manifest within CI environments. Your CI server might use your chart to spin up a new staging environment for each branch, creating a dynamic domain (e.g.\u00a0<code>my-branch.example.com<\/code>) to set as <code>ingressDomain<\/code>.<\/p>\n<h2 id=\"handling-development-environments\"><span class=\"ez-toc-section\" id=\"Handling_Development_Environments\"><\/span>Handling Development Environments<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We\u2019ve now got a functioning www-redirect working! You can stop here and deploy to production if you want, as the main goal of this tutorial has been achieved.<\/p>\n<p>That said, there are some issues with the approach we\u2019ve shown, particularly when working within CI development environments. Currently, each environment would have <code>www<\/code> prepended to its original domain.<\/p>\n<p>A way to resolve this is to replace <code>ingressDomain<\/code> with two independent variables:<\/p>\n<ul>\n<li><code>ingressBase<\/code> \u2013 your base domain, e.g.\u00a0<code>example.com<\/code><\/li>\n<li><code>ingressDomain<\/code> \u2013 the currently used domain, for this deployment, e.g.\u00a0<code>my-branch.example.com<\/code><\/li>\n<\/ul>\n<p>You can then use Helm variable comparisons to only enable the www-redirect when you\u2019re in a production environment.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">spec<\/span>:<span class=\"co4\">\n  rules<\/span><span class=\"sy2\">:\n<\/span>    <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> if eq .Values.ingressDomain .Values.ingressBase <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span><span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print <span class=\"st0\">\"www.\"<\/span> .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n    <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> else <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span><span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n    <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> end <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n          - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co4\">\n            backend<\/span>:<span class=\"co3\">\n              serviceName<\/span><span class=\"sy2\">: <\/span>my-service<span class=\"co3\">\n              servicePort<\/span><span class=\"sy2\">: <\/span>80<span class=\"co4\">\n  tls<\/span>:<span class=\"co4\">\n    - hosts<\/span><span class=\"sy2\">:\n<\/span>      - <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n      <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> if eq .Values.ingressDomain .Values.ingressBase <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n      - <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> print <span class=\"st0\">\"www.\"<\/span> .Values.ingressDomain <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span>\n      <span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> end <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><span class=\"co3\">\n      secretName<\/span><span class=\"sy2\">: <\/span><span class=\"br0\">{<\/span><span class=\"br0\">{<\/span> .Values.ingressTlsSecret <span class=\"br0\">}<\/span><span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>When deploying to production, set <code>ingressDomain<\/code> to the base domain \u2013 it should have the same value as <code>ingressBase<\/code>. The <code>if<\/code> condition will get matched, so the <code>www<\/code> ingress will be created.<\/p>\n<p>When you\u2019re deploying to a subdomain environment, the differing values of <code>ingressDomain<\/code> and <code>ingressBase<\/code> will disable the www-redirect.<\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Redirecting from a bare domain to the \u201cwww\u201d subdomain is a fundamental expectation of many public-facing websites. Using Nginx Ingress, you could apply this traditional behaviour to your containerised workloads deployed in the cloud.<\/p>\n<p>Add the annotation to your ingress resource and make sure <em>both<\/em> hosts are listed in its spec. Finish off by checking that the pair are also listed in any TLS certificates. Users should never talk to an unsecured endpoint, even if they\u2019re going to be redirected away from it.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/10240\/how-to-redirect-to-www-with-nginx-ingress\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Redirect to \u201cwww\u201d with Nginx Ingress \u2013 CloudSavvy IT&#8221; You\u2019ll often want to deploy a web application to the root of your domain, as well as the \u201cwww\u201d subdomain. This helps users discover your service. Nginx Ingress has built-in support for the procedure. Here\u2019s how to deploy a workload with two ingress hosts,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":205384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/02\/748108a6.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-205383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/205383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=205383"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/205383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/205384"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=205383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=205383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=205383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}