{"id":151,"date":"2025-12-29T05:32:20","date_gmt":"2025-12-29T05:32:20","guid":{"rendered":"https:\/\/thuanle.ca\/blog\/?p=151"},"modified":"2026-01-01T03:09:28","modified_gmt":"2026-01-01T03:09:28","slug":"wordpress-login-loop","status":"publish","type":"post","link":"https:\/\/thuanle.ca\/blog\/2025\/12\/29\/wordpress-login-loop\/","title":{"rendered":"WordPress Login Loop"},"content":{"rendered":"\n<p>Today, I tried to make a post on this blog but discovered that I wasn&#8217;t able to visit the wp-admin page to login. Visiting the page gave me a redirect error.<\/p>\n\n\n\n<p>I discovered that the issue was caused by my reverse proxy setup. Because of the reverse proxy, all traffic to my WordPress backend uses HTTP only. And because WordPress&#8217;s admin pages are designed to require HTTPS, it redirects me to use HTTPS, causing the infinite redirect loop.<\/p>\n\n\n\n<p>Anyway, I clearly fixed it if I was able to make a new post. <\/p>\n\n\n\n<p>For future reference, I will include the configuration to wp-config here.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>if (isset($_SERVER&#91;'HTTP_X_FORWARDED_PROTO'])){\n    $_SERVER&#91;'HTTPS'] = 'on';\n}<\/code><\/pre>\n\n\n\n<p>Every time my reverse proxy receives a request, it sets the HTTP_X_FORWARDED_PROTO variable to HTTPS to indicate that HTTPS was used. So if this is set, then WordPress will treat the HTTP request as HTTPS, allowing me to access the page.<\/p>\n\n\n\n<p>Anyway here is my updated HomeLab. I recently added a PiHole DNS server and a VaultWarden password manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"282725\" data-has-transparency=\"true\" style=\"--dominant-color: #282725;\" loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"428\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" src=\"https:\/\/thuanle.ca\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-from-2025-12-31-19-20-53.avif\" alt=\"\" class=\"wp-image-179 has-transparency\" srcset=\"https:\/\/thuanle.ca\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-from-2025-12-31-19-20-53.avif 968w, https:\/\/thuanle.ca\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-from-2025-12-31-19-20-53-300x133.avif 300w, https:\/\/thuanle.ca\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-from-2025-12-31-19-20-53-768x340.avif 768w\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today, I tried to make a post on this blog but discovered that I wasn&#8217;t able to visit the wp-admin page to login. Visiting the page gave me a redirect error. I discovered that the issue was caused by my reverse proxy setup. Because of the reverse proxy, all traffic to my WordPress backend uses [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":7,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/180"}],"wp:attachment":[{"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thuanle.ca\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}