How to set up WordPress behind a secure reverse proxy using NGINX

After getting your SSL-certificate and have enabled HTTPS redirection in NGINX, WordPress will not work due to mixed content (HTTP and HTTPS) – you won’t be able to login.

In order to fix this you first have to add this at the very start of your wp-config.php.

define('FORCE_SSL_ADMIN', true); if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';

Then in the end of the file add the following, replacing “website.com” with your own URL.

define('WP_HOME','https://website.com'); define('WP_SITEURL','https://website.com');

Finally you have to add the following to your NGINX-config in the site’s location block on your reverse proxy.

proxy_set_header X-Forwarded-Proto https;

Now it should be working! You should probably also add the plugin Really Simple SSL for their mixed content fixer.

3,027 thoughts on “How to set up WordPress behind a secure reverse proxy using NGINX”

  1. What if the WorPress Host behind the Proxy is not responding to https, but http only. So essentially the SSL is terminated on the NGINX Reverse proxy and it’s http traffic betweem the NGINX proxy and the WordPress Host?

  2. Yes, that is the way I do it too. It is the active file on the server running the reversed proxy, here called “reversed-proxy.conf”, that should be fixed – so “/etc/nginx/sites-available/reversed-proxy.conf” should be edited, adding proxy_set_header X-Forwarded-Proto https; inside the location block of your site.

    Then restart NGINX with
    nginx -t
    systemctl reload nginx

    Did it work?

  3. Have you ever considered creating an ebook or guest authoring on other blogs?

    I have a blog centered on the same ideas you discuss and would really like to
    have you share some stories/information. I know my audience would value your
    work. If you are even remotely interested, feel free to shoot me
    an e mail.

  4. Heya this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding skills so I wanted to get advice from someone with experience. Any help would be greatly appreciated!|

  5. certainly like your web-site however you need to take a look at the spelling on quite a few
    of your posts. A number of them are rife with spelling issues and I to
    find it very bothersome to inform the reality however I
    will definitely come back again.

  6. It’s actually a great and useful piece of info. I am satisfied that you simply shared this helpful information with us. Please keep us up to date like this. Thank you for sharing.|

  7. Howdy just wanted to give you a quick heads up and let you know a few of the images aren’t loading properly. I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same outcome.|

  8. Hello! I’ve been reading your site for a while now and finally got the bravery to go ahead and give you a shout out from Dallas Tx! Just wanted to mention keep up the good job!|

  9. all the time i used to read smaller articles which as well clear their motive, and that is also happening with this piece of writing which I am reading at this place.

  10. Its like you read my thoughts! You appear to know a lot approximately this, such as you wrote the e-book in it or something. I think that you just can do with a few percent to force the message home a little bit, however other than that, this is wonderful blog. A fantastic read. I’ll definitely be back.|

  11. Does your blog have a contact page? I’m having a tough time locating it but, I’d like to shoot you an e-mail. I’ve got some ideas for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it develop over time.|

  12. Hello! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa? My site addresses a lot of the same topics as yours and I believe we could greatly benefit from each other. If you might be interested feel free to send me an email. I look forward to hearing from you! Wonderful blog by the way!|

  13. Hello, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam remarks? If so how do you protect against it, any plugin or anything you can recommend? I get so much lately it’s driving me insane so any help is very much appreciated.|

  14. When some one searches for his vital thing, so he/she wants to be available that in detail, therefore that thing is maintained over here.|

  15. Undeniably believe that which you stated. Your favourite reason appeared to be on the internet the easiest thing to have in mind of. I say to you, I certainly get irked whilst other folks think about concerns that they just don’t understand about. You controlled to hit the nail upon the top and defined out the whole thing without having side-effects , other folks can take a signal. Will probably be back to get more. Thank you|

  16. If some one needs expert view concerning running a blog afterward i advise him/her to pay a visit this website, Keep up the fastidious work.|

  17. Hey very cool web site!! Guy .. Excellent .. Wonderful .. I will bookmark your web site and take the feeds also? I am glad to find numerous useful information here in the post, we’d like develop more strategies in this regard, thank you for sharing. . . . . .|

  18. I’m not that much of a online reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your site to come back later on. Cheers|

  19. Ahaa, its nice dialogue about this piece of writing at this place at this blog, I have read all that, so now me also commenting at this place.|

  20. I just want to say I am newbie to blogging and truly loved this web blog. Probably I’m likely to bookmark your website . You actually come with remarkable writings. Many thanks for revealing your website page.

  21. Spot on with this write-up, I really think this site needs a great deal more attention. I’ll probably be back again to read more, thanks for the info!|

  22. Excellent blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol

  23. Wow, marvelous weblog layout! How lengthy have you been blogging for? you made blogging glance easy. The overall look of your website is fantastic, as well as the content!

  24. If you are going for most excellent contents like I do, only go to see this website everyday for the reason that it gives feature contents, thanks|

  25. I don’t even know how I ended up here, but I thought this post was great. I don’t know who you are but certainly you are going to a famous blogger if you aren’t already 😉 Cheers!

  26. Wow! At last I got a website from where I be capable of actually take useful data regarding my study and knowledge.

  27. Heya i’m for the primary time here. I found this board and I find It truly helpful & it helped me out much. I am hoping to give one thing again and aid others such as you aided me.|

  28. It’s going to be end of mine day, but before finish I am reading this great article to improve my knowledge.

  29. Hiya, I am really glad I’ve found this information. Nowadays bloggers publish only about gossips and net and this is actually irritating. A good blog with interesting content, this is what I need. Thanks for keeping this website, I’ll be visiting it. Do you do newsletters? Cant find it.

  30. you’re truly a good webmaster. The web site loading speed is amazing. It sort of feels that you are doing any distinctive trick. Moreover, The contents are masterwork. you have performed a excellent activity on this topic!|

  31. You have made some good points there. I looked on the web for more information about the issue and found most individuals will go along with your views on this site.|

  32. Hey! Someone in my Facebook group shared this website with us so I came to give it a look. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Superb blog and excellent design and style.|

  33. May I simply say what a comfort to uncover somebody who truly understands what they are discussing on the web. You definitely know how to bring an issue to light and make it important. More people should read this and understand this side of your story. I was surprised that you are not more popular since you most certainly have the gift.

  34. Right here is the perfect website for anyone who really wants to understand this topic. You realize so much its almost tough to argue with you (not that I actually will need to…HaHa). You definitely put a fresh spin on a topic that has been written about for decades. Excellent stuff, just great.

  35. Its such as you learn my mind! You seem to grasp so much about this, like you wrote the guide in it or something. I believe that you could do with a few percent to force the message house a little bit, however instead of that, that is excellent blog. An excellent read. I’ll certainly be back.|

  36. You are so interesting! I don’t believe I’ve truly read through anything like that before. So great to discover someone with some unique thoughts on this issue. Really.. thanks for starting this up. This site is something that is required on the internet, someone with a bit of originality.

  37. I’m amazed, I must say. Rarely do I encounter a blog that’s both educative and interesting, and let me tell you, you have hit the nail on the head. The problem is something which too few men and women are speaking intelligently about. Now i’m very happy I came across this in my search for something concerning this.

  38. Howdy! I could have sworn I’ve been to your blog before but after looking at many of the articles I realized it’s new to me. Nonetheless, I’m certainly happy I came across it and I’ll be bookmarking it and checking back frequently!|

  39. A further issue is that video games usually are serious in nature with the most important focus on understanding rather than entertainment. Although, there’s an entertainment element to keep your sons or daughters engaged, each game is generally designed to focus on a specific skill set or area, such as instructional math or scientific research. Thanks for your post.

  40. My programmer is trying to convince me to move to .net from PHP. I have always disliked the idea because of the expenses. But he’s tryiong none the less. I’ve been using WordPress on various websites for about a year and am worried about switching to another platform. I have heard fantastic things about blogengine.net. Is there a way I can import all my wordpress posts into it? Any help would be really appreciated!|

  41. This design is incredible! You most certainly know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job. I really loved what you had to say, and more than that, how you presented it. Too cool!|

  42. When I initially left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I recieve 4 emails with the exact same comment. Perhaps there is an easy method you are able to remove me from that service? Thanks a lot.

  43. You are so cool! I do not believe I’ve truly read anything like that before. So great to find someone with some original thoughts on this topic. Seriously.. thanks for starting this up. This web site is one thing that is required on the web, someone with a little originality.

  44. Spot on with this write-up, I actually believe this amazing site needs far more attention. I’ll probably be returning to read more, thanks for the advice.

  45. I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my view, if all website owners and bloggers made good content as you did, the internet will be a lot more useful than ever before.|

  46. Thank you for the auspicious writeup. It in reality was a leisure account it. Glance advanced to far delivered agreeable from you! By the way, how can we communicate?|

  47. I’m not that much of a online reader to be honest but
    your sites really nice, keep it up! I’ll go ahead and bookmark your site to come back in the future.
    Many thanks

  48. Appreciating the persistence you put into your blog and in depth information you present. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material. Great read! I’ve saved your site and I’m adding your RSS feeds to my Google account.|

  49. Nice weblog right here! Also your website rather a lot up fast! What host are you using? Can I am getting your associate hyperlink to your host? I desire my website loaded up as quickly as yours lol|

  50. hi!,I like your writing so much! proportion we be in contact more about your post on AOL? I require an expert on this house to solve my problem. May be that’s you! Looking ahead to see you. |

  51. I’m excited to discover this website. I need to to thank you for ones time for this particularly wonderful read!! I definitely liked every part of it and i also have you saved to fav to see new information in your website.|

  52. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve four emails with the exact same comment. There has to be a means you can remove me from that service? Cheers.

  53. Wonderful work! This is the type of info that should be shared around the internet.

    Disgrace on Google for now not positioning this submit higher!
    Come on over and consult with my website . Thank you =)

  54. My brother suggested I might like this blog. He was totally right.
    This post truly made my day. You cann’t imagine just how much time I
    had spent for this information! Thanks!

  55. Hey there! This is my 1st comment here so I just wanted to give a quick shout out and say I truly enjoy reading through your blog posts. Can you recommend any other blogs/websites/forums that deal with the same topics? Thank you so much!|

  56. Great weblog right here! Additionally your web site a lot up fast! What host are you the usage of? Can I get your associate link in your host? I desire my site loaded up as fast as yours lol

  57. Terrific article! That is the kind of information that are meant to be shared around the net. Shame on the search engines for not positioning this publish higher! Come on over and visit my website . Thank you =)|

  58. Greetings! Very helpful advice in this particular article! It is the little changes that produce the greatest changes. Many thanks for sharing!

  59. Have you ever considered about adding a little bit more than just your articles? I mean, what you say is valuable and all. Nevertheless think of if you added some great photos or videos to give your posts more, “pop”! Your content is excellent but with images and video clips, this blog could certainly be one of the best in its field. Fantastic blog!|

  60. Good way of describing, and nice post to take facts on the topic of my presentation topic, which i am going to deliver in school.

  61. Useful info. Lucky me I discovered your site by accident, and I’m surprised why this twist of fate did not happened earlier!
    I bookmarked it.

  62. Having read this I believed it was extremely informative. I appreciate you spending some time and energy to put this short article together. I once again find myself personally spending a lot of time both reading and commenting. But so what, it was still worth it!|

  63. Знаете ли вы?
    Российская учёная показала, что проект «Новой Москвы» 1923 года воспроизводил план трёхвековой давности.
    Один из старейших музеев Амстердама находится в церкви на чердаке.
    Ливийский диктатор пытался спасти от казни премьер-министра Пакистана.
    Свадьба английского рыцаря стала причиной войны между двумя могущественными родами.
    Кустурица пропустил получение «Золотой ветви» в Каннах, так как любит друзей больше, чем церемонии награждения.

    arbeca

  64. Знаете ли вы?
    Американская энциклопедия включила в себя десятки статей о вымышленных людях, якобы связанных с Латинской Америкой.
    Сооснователь и глава Социал-демократической партии Великобритании стал бароном.
    Консервативные художественные критики обрушились на портрет девушки, называя её гермафродитом, дочерью Каина и проституткой.
    Жену Генриха VIII на суде защищал посол Священной Римской империи.
    Среди клиентов древнеримского афериста был император Марк Аврелий.

    http://www.arbeca.net/

  65. Знаете ли вы?
    Битву русских дружин и монголо-татар возле леса отмечают сразу в трёх селениях.
    Советские военные операторы на базе ленд-лизовского кинопулемёта и ППШ создали киноавтомат.
    Китай реализует в Пакистане собственный План Маршалла.
    Владелец вернул похищенную картину Пикассо почтой, не найдя покупателей.
    Иракский физрук получил мировую известность под псевдонимом «ангел смерти».

    arbeca

  66. Знаете ли вы?
    Мама и четверо детей снимают фильмы о своей жизни во время войны.
    Среди клиентов древнеримского афериста был император Марк Аврелий.
    Один из старейших музеев Амстердама находится в церкви на чердаке.
    В Чехословакии и СССР был свой «поцелуй победы».
    Не удержавшись от писательства, Амалия Кахана-Кармон создала одну из важнейших книг в истории Израиля.

    http://arbeca.net/

  67. Знаете ли вы?
    Бразильский дипломат принимал непосредственное участие в создании государства Восточный Тимор.
    Один из старейших музеев Амстердама находится в церкви на чердаке.
    Клирик-саксонец стать папой римским не захотел, а патриархом Севера не смог.
    Роден назвал свои «Врата ада» напрямую, а его соотечественник только намекнул.
    Преподаватель нескольких университетов, попавший в сталинские лагеря, и там умудрился обучать математике на куске мыла.

    http://www.arbeca.net/

  68. I want to to thank you for this great read!! I absolutely enjoyed
    every little bit of it. I’ve got you book
    marked to check out new stuff you post…

  69. Знаете ли вы?
    Картина парада Победы, где руководство страны смещено на задний план, получила Сталинскую премию.
    Ливийский диктатор пытался спасти от казни премьер-министра Пакистана.
    Русские мечтали о шапке-невидимке, а древние греки — о кольце невидимости.
    Залётная птаха занесена в перечень птиц России спустя более полувека после открытия вида.
    Клирик-саксонец стать папой римским не захотел, а патриархом Севера не смог.

    http://www.arbeca.net/

  70. At this moment I am ready to do my breakfast,
    afterward having my breakfast coming again to read further news.

  71. Hey! Would you mind if I share your blog with my zynga group? There’s a lot of people that I think would really appreciate your content. Please let me know. Cheers|

  72. I’m impressed, I have to admit. Rarely do I come across a blog that’s equally educative and entertaining, and let me tell you, you’ve hit the nail on the head. The problem is something that not enough people are speaking intelligently about. I’m very happy that I stumbled across this during my hunt for something relating to this.

  73. What’s Happening i’m new to this, I stumbled upon this I have found It
    positively useful and it has helped me out loads.
    I am hoping to give a contribution & aid other customers like its helped me.

    Great job.

  74. I’m amazed, I must say. Seldom do I encounter a blog that’s both equally educative and engaging, and let me tell you, you’ve hit the nail on the head. The issue is an issue that not enough people are speaking intelligently about. I am very happy I stumbled across this during my hunt for something concerning this.