Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jun 27, 2011 11:38 am 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 12:57 pm
Posts: 19
As a noob to Nginx I must say I love it quite a bit. My only complaint might be that there is no easy way to let people add rewrite rules. This I can live with though. I have noticed some Linode users are running Nginx and Apache. Sounds like all the static content such as images and html pages are being loaded in Nginx and dynamic content on Apache 2.

Wondering if I should do something like this or just use Nginx and the PHP-fpm that I have setup now and leave it. Advantages to either approach?


Top
   
PostPosted: Mon Jun 27, 2011 11:42 am 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
mjruschak wrote:
My only complaint might be that there is no easy way to let people add rewrite rules.


viewtopic.php?p=35445#35445


Top
   
 Post subject:
PostPosted: Mon Jun 27, 2011 11:56 am 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 12:57 pm
Posts: 19
What I meant was. There is no easy way to let people add them in something like .htaccess files. Am I wrong? Creating the rewrite rules is not the issue for me.


Top
   
 Post subject:
PostPosted: Mon Jun 27, 2011 12:00 pm 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
mjruschak wrote:
What I meant was. There is no easy way to let people add them in something like .htaccess files. Am I wrong? Creating the rewrite rules is not the issue for me.

No, nginx hasn't .htaccess-like files.
Why do you want let people to change .htaccess on your site?


Top
   
 Post subject:
PostPosted: Mon Jun 27, 2011 12:07 pm 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 12:57 pm
Posts: 19
I don't really. I can just see some people asking why they have to go through me to change the rewrite rules... This really isn't the issue though. Again I can live without that.

Simply put. I just noticed that a lot of folks on here are running a reverse proxy and was wondering what the advantages if any of that would be. I don't see any but being a new Nginx user I am not totally aware of any (if any) disadvantageous.

I apologize. I could of communicated my question better in the original post which was vague.


Top
   
 Post subject:
PostPosted: Mon Jun 27, 2011 1:08 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
mjruschak wrote:
Simply put. I just noticed that a lot of folks on here are running a reverse proxy and was wondering what the advantages if any of that would be. I don't see any but being a new Nginx user I am not totally aware of any (if any) disadvantageous.

Well, given an existing nginx/php configuration, I don't think there are any automatic advantages, sans something Apache can do that nginx can't. In terms of disadvantages, I suppose it's really just needing to support two server configurations and their integration, plus whatever additional resource running two servers takes up. So I wouldn't do it just for the heck of it, but there are certainly cases where it can make sense.

I think that typically people end up down this road by having used Apache first - often with mod_php rather than trying to set up a standalone php server - and then trying to further tune the resource it is using. So fronting it with nginx is an easy way to reduce load for static resources, while retaining their existing configuration with Apache handle the dynamic stuff.

When coming at it the other way (already having nginx and php working without Apache), there's less of an incentive to introduce Apache to the mix. However, I certainly wouldn't hesitate to do so if it had a feature that I particularly wanted. Whether that be .htaccess, better integration/support with an application stack you are using, or just some feature nginx can't quite match (e.g., cgi-bin), adding Apache behind nginx can in such cases be the best approach. But the need threshold is perhaps a little higher to add Apache to an existing nginx installation than vice versa.

Or to put it another way, let's say .htaccess support for users in their own private folders was a requirement (rather than a thought experiment) for your system for some reason. I wouldn't have any problems recommending the introduction of Apache and having nginx proxy requests for those portions of the site to it, rather than trying any workarounds to keep solely using nginx. And as with going the other direction, there's no real reason to disrupt your existing nginx/php setup by completely switching to Apache - just insert it into the mix for the stuff you need it for.

-- David


Top
   
 Post subject:
PostPosted: Mon Jun 27, 2011 1:30 pm 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 12:57 pm
Posts: 19
Exactly what I was looking for. Thank you!


Top
   
 Post subject:
PostPosted: Mon Jul 04, 2011 5:13 am 
Offline
Senior Member

Joined: Fri Jul 03, 2009 2:31 am
Posts: 54
ICQ: 897607
I run both nginx and apache on a couple of linodes.

Some apache modules, which don't have equivalents on nginx, are a primary reason for still using apache. mod_security for exampley. I mostly still use it for mod_wsgi for my Django apps, which is really stable and gives me the performance I need.

Apache can be made reasonably lightweight by stripping out all the modules you don't need and running in mpm-worker model (instead of mpm-prefork). This means for PHP apps you need to move away from mod-php to something like mod-fcgid so as to avoid any PHP threading problems and to make apache processes lighter.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group