The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Nginx vs. Apache, All Things Considered

    Nginx vs. Apache, All Things Considered

    Technical SEO Issues
    9 4 939
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danny.wood
      danny.wood last edited by

      Hey Peeps,

      I've been struggling lately with a new static site, and I'm looking for anyone's opinion who's had to optimize a site using Nginx. I understand that Nginx is recommended for static sites, however I want to avoid being in a situation where I can't do things like write redirect rules the way I want to.

      Considering that it will be hosting a Static site, are there any features or functions that Nginx lacks when compared to Apache, such as ability to write rewrite rules, etc.?

      1 Reply Last reply Reply Quote 1
      • customerparadigm.com
        customerparadigm.com last edited by

        Danny - We use Nginx on our WordPress site, and it's pretty quick and easy.  We're able to use the same .htaccess rules to handle rewrites, and for the most part, there's very little downside. You do want to make sure that your site isn't going to break before you launch it on Nginx, so I'd test it with a test URL first before you push it live.

        We're also running Varnish as a caching system, and our page load speed takes the page from a slowwww load time to a really fast 1.5 second load time.

        Hope this helps...

        1 Reply Last reply Reply Quote 1
        • danny.wood
          danny.wood last edited by

          Thanks Jeff!

          I think we're going to go with Apache for now, since it's what all of us are well-versed in. We'll probably be switching to Nginx at some point in the future, and focusing on other aspects that you mentioned, such as caching and compression, in the meantime.

          Cheers.

          1 Reply Last reply Reply Quote 0
          • MatShepSEO
            MatShepSEO last edited by

            From the little I know of Nginx, I know it is meant to be faster, less intensive on server memory and able to handle more concurrent connections, but Apache is more widely supported across different servers and is more flexible out of the box.

            The one thing I have had to get my head around in working on clients sites that run on Nginx is the different URL rewrite rules i.e. http://nginx.org/en/docs/http/converting_rewrite_rules.html

            1 Reply Last reply Reply Quote 1
            • caseyhen
              caseyhen last edited by

              Hi Danny,

              The Moz.com website/blog are running on PHP/Nginx. As Matthew said, Nginx is much faster and less intensive on the servers for both CPU and memory. Nginx has some great documentation and is really easy to get things to redirect. It's as easy as adding lines like the following to your configuration and your good to go:

              rewrite ^/q$ /community/q permanent;
              rewrite ^/q/(.*)$ /community/q/$1 permanent;

              Making the switch from Apache to Nginx was one of the best things we ever did and I would highly suggest you do the same thing for both static and any dynamic sites you may have. I'll most likely never use Apache again.

              Casey

              danny.wood 1 Reply Last reply Reply Quote 2
              • danny.wood
                danny.wood @caseyhen last edited by

                Thanks Casey!

                We've actually found a different work-around that we are looking at right now, using the "pageless redirects" plugin for Jekyll. Basically it uses the meta refresh + rel canon redirection method that Matt Cutts got called out on a while ago. This would allow us to stay on S3 and maintain our blazing fast site speed.

                Through my research so far, this seems to pass equity in much the same way as a Server App 301.. Have you had any experiences/heard anything to the contrary?

                caseyhen 1 Reply Last reply Reply Quote 1
                • caseyhen
                  caseyhen @danny.wood last edited by

                  Hey Danny,

                  I've always done 301 redirects from the server and avoided any other method. This was more for my sanity to make sure that I was getting all the equity I could if there was a difference, not saying there is a difference but if there way, I wanted to be safe. Since it sounds like you may be constrained by your technology, the solution you are going with is fine but if you had both options available, I'd go with the server side redirect always.

                  danny.wood 1 Reply Last reply Reply Quote 1
                  • danny.wood
                    danny.wood @caseyhen last edited by

                    Yup, I'm in the same boat as you, I'd much rather do server-side redirects..

                    As an update on this "project", we used the pageless redirects in our staging environment on S3 just now, but were unsuccessful. Certain redirects that we set up in pageless redirects, (such as adding a trailing slash to URLs without,) got clobbered by S3's default setting of 302ing to adding a trailing slash. Weak sauce, Amazon!

                    At this point, we're going with Apache, since it's the App that our developers know best and we've had too many problems to experiment with our live environment. This being said, our next project after we relaunch with proper redirects will be to begin testing on our stage with Nginx 🙂

                    Thanks for your input!

                    caseyhen 1 Reply Last reply Reply Quote 1
                    • caseyhen
                      caseyhen @danny.wood last edited by

                      Great to hear. Let me know if you have any question when you start that project.

                      Casey

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      • Optimizing PDF Viewers for SEO: Issuu vs Flippingbook vs Dual Option
                        iugac
                        iugac
                        0
                        2
                        352

                      • vs.
                        NickJasuja
                        NickJasuja
                        0
                        4
                        3.5k

                      • 301 vs 302
                        GastonRiera
                        GastonRiera
                        0
                        3
                        2.8k

                      • 403s vs 404s
                        jesse-landry
                        jesse-landry
                        1
                        4
                        813

                      • Picking a URL co.uk vs .net vs .biz which is best for SEO?
                        Brian-H
                        Brian-H
                        0
                        3
                        746

                      • Is this considered Duplicate Content?
                        Prime85
                        Prime85
                        0
                        5
                        333

                      • Sitefinity vs Wordpress
                        AlanMosley
                        AlanMosley
                        0
                        6
                        5.5k

                      • Is this considered as duplicate content?
                        KeriMorgret
                        KeriMorgret
                        0
                        3
                        815

                      Get started with Moz Pro!

                      Unlock the power of advanced SEO tools and data-driven insights.

                      Start my free trial
                      Products
                      • Moz Pro
                      • Moz Local
                      • Moz API
                      • Moz Data
                      • STAT
                      • Product Updates
                      Moz Solutions
                      • SMB Solutions
                      • Agency Solutions
                      • Enterprise Solutions
                      • Digital Marketers
                      Free SEO Tools
                      • Domain Authority Checker
                      • Link Explorer
                      • Keyword Explorer
                      • Competitive Research
                      • Brand Authority Checker
                      • Local Citation Checker
                      • MozBar Extension
                      • MozCast
                      Resources
                      • Blog
                      • SEO Learning Center
                      • Help Hub
                      • Beginner's Guide to SEO
                      • How-to Guides
                      • Moz Academy
                      • API Docs
                      About Moz
                      • About
                      • Team
                      • Careers
                      • Contact
                      Why Moz
                      • Case Studies
                      • Testimonials
                      Get Involved
                      • Become an Affiliate
                      • MozCon
                      • Webinars
                      • Practical Marketer Series
                      • MozPod
                      Connect with us

                      Contact the Help team

                      Join our newsletter
                      Moz logo
                      © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                      • Accessibility
                      • Terms of Use
                      • Privacy