How to remove the www from URL with nginx server

Nginx web server is becoming most popular in these year. Best server response time and minimum execution time is the advantages of Nginx server. wordpress.com itself using the nginx server for hosting these sites and blogs.

Many people want to remove the www from URL. I will tell you the tip how to remove the www from URL with nginx server.

Open your Ngnix configuration file (nginx.conf). Just use following code in server block.

if ($host ~* ^www\.(.*)) {
    set $remove_www $1;
    rewrite ^(.*)$ http://$remove_www$1 permanent;
}

This code will remove the www from the URL.

You may like following Articles!

  • Pingback: uberVU - social comments

  • http://www.tenlist.com/roll-insulation/columbus-OH/ Sherwood Alicuben

    Thank you for writing such an appealing post. Normall I see the same thing and it starts to get on my nearves. Thanks again and I’ll be back for more.

  • http://www.GO-RUNIT.COM Tinisha Holsclaw

    This is a excellent post, but I was wondering how do I suscribe to the RSS feed?

  • http://www.WHITEPINEACUPUNCTUREANDMASSAGE.COM Edwardo Aboulissan

    I’m happy I located this web site, I couldnt get any information on this topic before. Also manage a site and for anyone who is ever interested in doing some visitor writing for me you should feel free to let me know, i’m always look for people to check out my blog page. Please stop by and leave a comment sometime!

  • http://www.liceob69.com Cristine Hutt

    Terrific site, where did you come up with the info in this summary? I’m glad I found it though, ill be checking back soon to see what other articles you have.

  • http://travel-physical-therapy.blogspot.com/ Enrique Sossaman

    I REALLY liked your post and blog! It took me a minute bit to find your site…but I bookmarked it. Would you mind if I posted a link back to your post?

  • http://holidaystream.com Corinne Rhein

    I’ve just started off a blog, the knowledge you give on this site has aided me extremely. Thank you for all your time & work.

  • http://best-stress-management.info Shannon Janosek

    Intriguing post. I have been searching for some good resources for solar panels and discovered your blog. Planning to bookmark this one!

  • http://best-stress-management.info Marcos Victory

    Hello, this is my first time i visit here. I found so many interesting in your blog especially on how to determine the topic. keep up the good work.

  • http://treatment-hair-loss.info Christopher Rahr

    Awesome post. I so good to see someone taking the time to share this information

  • http://paid2surveys.info Enrique Sossaman

    Hello, this is my first time i visit here. I found so many interesting in your blog especially on how to determine the topic. keep up the good work.

  • http://back-pain-lower.info Samuel Gambaiani

    I was just having a conversation over this I am glad I came across this it cleared some of the questions I had.

  • http://uautocity.info Jennifer Himmelwright

    I’ve just started off a blog, the knowledge you give on this site has aided me extremely. Thank you for all your time & work.

  • http://mbamessage.com Werner Legoullon

    Intriguing post. I have been searching for some good resources for solar panels and discovered your blog. Planning to bookmark this one!

  • http://best-antiaging.info Trudi Janacek

    I’ve been checking your blog for a while now, seems like everyday I learn something new :-) Thanks

  • http://eyes-diseases.info Charlie Pollack

    Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader

  • http://www.ifoodlinks.com/ Dudley Codell

    Nice post! You truly have a wonderful way of writing which I find captivating! I will definitely be bookmarking you and returning to your blog. In fact, your post reminded me about a strange thing that happened to me the other day. I’ll tell you about that later…