Nginx vs. Apache, All Things Considered
-
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.?
-
Great to hear. Let me know if you have any question when you start that project.
Casey
-
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!
-
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.
-
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?
-
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
-
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
-
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.
-
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...
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Domain Authority vs. Page Authority: What’s More Important?
I have a couple of questions about this. First of all is one more important than the other? Also, I currently have a website setup for https://gogoanime.city. How is it possible to grow page authority yet I am having a hard time growing domain authority. Thank you !
Technical SEO | | gogoanimetp0 -
Are links still considered reciprocal if the link from one website is rel="nofollow" and the other isnt ?
Im working on a site that has some press coverage due in the next couple of days from quite a big site in the niche. The press outlet has requested that we link back to the content they post about us, they said the link can be rel="nofollow" if we'd prefer. Id really like to get the full benefit of the link back to our website, obviously if i did a straight link back to the 3rd party press site the links would be reciprocal and cancel each other out in terms of "link juice", but i was wandering if we make our link back to the 3rd party rel="nofollow" will we still get the full benefit of their link to us in terms of link juice ? ie. having the link back to them, but nofollow wouldn't been seen as a reciprocal link. ? (Obviously either way there is still benefit of having the link even if it reciprocal as it will send traffic to our site, but just no "link juice") Note - Ive used the phrase"Link Juice" for lack of a better term, any ideas on how else to refer to this ?
Technical SEO | | Sam-P1 -
Meta Description VS Rich Snippets
Hello everyone, I have one question: there is a way to tell Google to take the meta description for the search results instead of the rich snippets? I already read some posts here in moz, but no answer was found. In the post was said that if you have keywords in the meta google may take this information instead, but it's not like this as i have keywords in the meta tags. The fact is that, in this way, the descriptions are not compelling at all, as they were intended to be. If it's not worth for ranking, so why google does not allow at least to have it's own website descriptions in their search results? I undestand that spam issues may be an answer, but in this way it penalizes also not spammy websites that may convert more if with a much more compelling description than the snippets. What do you think? and there is any way to fix this problem? Thanks!
Technical SEO | | socialengaged
Eugenio0 -
Duplicate Content: Canonicalization vs. Redirects
Hi all, I have a client that I recently started working with whose site was built with the following structure: domain.com
Technical SEO | | marisolmarketing
domain.com/default.asp Essentially, there is a /default.asp version of every single page on the site. That said, I'm trying to figure out the easiest/most efficient way to fix all the /default.asp pages...whether that be 301 redirecting them to the .com version, adding a canonical tag to every .asp page, or simply NOINDEXing the .asp pages. I've seen a few other questions on here that are similar, but none that really say which would be the easiest way to accomplish this without going through every single page... Thanks in advance!0 -
Fixing up poorly performing eCommerce SIte with content? First things first..
I had a small site that was performing well enough for me for 6 years--nice source of extra family income. It was a very out of date platform (1990's) and I moved it to Big Commerce in December. Since then visits and sales have just plummeted. It has died and I am sad. I want to remain positive. It's a viable niche product line, I have tons of quality inventory, my site platform is current. I am a good writer and am willing to add content if it will help. From what I can determine apart from technical issues I may not know about I think I suffer from THIN CONTENT. I want to pretend I'm opening a new business and start over in today's environment. I have had bad experiences with two SEO consultants (one ripped me off financially, the other gave me advice that hurt me) so I have no choice but to educate myself. I got started in ecommerce back in 1998 with the help of many wonderful kind people on forums so I'm turning to this resource once again. What would you do first if you were me especially to get some revenue flowing asap? I need help. I need to know if there is hope or if I should liquidate at the nearest swap meet 😉 Thanks! decorativedishes.net
Technical SEO | | ddktt1 -
Post vs page in Wordpress?
Hello there, I have a Wordpress site and would like to know if it is better to have 600 posts or 600 pages in terms of efficiency in the site. I would like to publish the content as pages, as I can have subapges,etc... and keep the path: www.website.com/page/subpage1... in terms of good SEO. This structure of using pages rahter than posts allow me to keep the path as stated above (with a category/post path I could not manage in this sense as a pile of articles is displayed although the path category/post in terms of SEO I understand would be good too). Thank you very much for your thoughts here as I would go for a page structure. Antonio
Technical SEO | | aalcocer20030 -
Main vs Pointing URL Confusion
Hi, I have a new website that deals with 3 very similar businesses The main purpose of the website is to assist the consumer to search, compare and book chaffered transportation online. The 3 businesses are taxi cab hire, limo hire, party bus hire. My main domain is www.mytaxicab.co.za. I also own the domains mylimo.co.za and mypartybus.co.za. My question is, from a best practice SEO perspective, how should I set this up. Should I have one main site www.mytaxicab.co.za and have the 2 other niche domain names point in eg user types www.mypartybus.co.za and lands on www.mytaxicab.co.za/party-bus-hire or is there a better way? Any help or insite would be appreciated
Technical SEO | | chirsirwin0 -
Www vs non www and understanding opensite
Hi Guys, New guy here with some questions regarding the difference between www and non www. I am helping with a site at the moment and gradually working my way through bits and learning all the time. I was watching one of the seomoz videos and it brought my attention back to www vs non www. I understand that google will treat these as two seperate sites but wanted to check what the stats are telling me. I was under the impression that www.mydummysite.com was getting most links etc as this is what I have always used. However when I used Opensite explorer it told me something different as follows: www.mydummysite.com 32/100 29/100 5 16 mydummysite.com 32/100 29/100 2 1,500 Am i correct in saying that i should be adding a redirect from www.mydummysite.com to mydummysite.com ???? I am thinking that this is telling me that I am potentially missing out on 1,500 links to my site but it could mean I am missing out on just 16. Eitherway I guess its something I should fix right? Do I just redirect that page or would all pages beneith it such as mydummysite.com/news also need redirect??? Can i use Canonical Rel links for this now? Thanks for taking the time to read and reply! 🙂
Technical SEO | | wedmonds0