Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
NginX Web Server with Magento
 
samm
Jr. Member
 
Total Posts:  29
Joined:  2009-04-02
 

btw, why not to use

## These locations would be hidden by .htaccess normally
    location /lib/minify/         { allow all}  ## Deny is applied after rewrites so must specifically allow minify
    
location ~ ^/(app|includes|media/downloadable|pkginfo|report/config.xml|var)/                { deny all}
instead of
## These locations would be hidden by .htaccess normally
    location /app/                { deny all}
    location 
/includes/           { deny all}
    location 
/lib/                { deny all}
    location 
/lib/minify/         { allow all}  ## Deny is applied after rewrites so must specifically allow minify
    
location /media/downloadable{ deny all}
    location 
/pkginfo/            { deny all}
    location 
/report/config.xml   { deny all}
    location 
/var/                { deny all}

?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Turnkeye
Enthusiast
 
Avatar
Total Posts:  908
Joined:  2008-12-20
URL: turnkeye.com
 
samm - 02 April 2010 01:34 PM

A long time ago btw. Now we are running on latest stable with some local modifications.

Yes, I see ”nginx/0.7.65” in my ServerSpy Firefox extension. I happy to know that MagentoCommerce.com switched to NginX wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre Valente
Jr. Member
 
Total Posts:  1
Joined:  2010-03-22
 

Hi,

Just a quick note on the “Flex library not loaded” problem. It is related with the deny all on /lib/.

I’ve fixed it by removing /lib/ from the main “deny all” section and adding more detail to it separately.

location ~ (/(app/|includes/|/pkginfo/|var/|report/config.xml)|/\.svn/|/.hta.+) {
   deny all
;
}

location 
/lib{
    allow 127.0.0.1
/32;
    
deny all;
}

As we are processing php scripts with FastCGI on 127.0.0.1, this means that php can access the files (thus loading the flex library), but the rest of the world can’t.

Hope it helps,
Andre Valente

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mosses Akizian
Sr. Member
 
Avatar
Total Posts:  176
Joined:  2009-04-28
Los Angeles, CA
 
samm - 02 April 2010 01:34 PM

A long time ago btw. Now we are running on latest stable with some local modifications.

Samm- who are you hosting with?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Turnkeye
Enthusiast
 
Avatar
Total Posts:  908
Joined:  2008-12-20
URL: turnkeye.com
 
monocat - 19 April 2010 02:26 PM

samm - 02 April 2010 01:34 PM
A long time ago btw. Now we are running on latest stable with some local modifications.

Samm- who are you hosting with?

I sure they use dedicated servers, NginX optimized.

 
Magento Community Magento Community
Magento Community
Magento Community
 
clockworkgeek
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-31
 
samm - 02 April 2010 01:46 PM

btw, why not to use

## These locations would be hidden by .htaccess normally
    location /lib/minify/         { allow all}  ## Deny is applied after rewrites so must specifically allow minify
    
location ~ ^/(app|includes|media/downloadable|pkginfo|report/config.xml|var)/                { deny all}
?

Because of processing speed. One way accesses a hash table and the other processes a regexp. I admit there isn’t much difference for a short list. Also it affects order of precedence and ease of maintenance slightly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
optimumenergy
Jr. Member
 
Total Posts:  17
Joined:  2010-02-25
 
baten - 26 March 2010 10:07 AM

@clockworkgeek:

Thank you very very much for your detailled and good description.

It is working now: Magento with NGINX and SSL on Amazon EC2 infrastructure. Your config part:

fastcgi_param HTTPS $fastcgi_https;

solved my last problem which resulted in a redirect loop before.

Greets,
baten

Are you running from your webserver root folder or from a subfolder. Few of us are having trouble getting it to run from the non-root folder.

We need an Amazon AMI smile Don’t suppose you’d create one?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bj0rn
Member
 
Avatar
Total Posts:  37
Joined:  2008-06-16
 

Has anyone created an AMI from this thread? It would be so amazing to be able to get this “out of the box” for us non-techy types wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagenX
Enthusiast
 
Total Posts:  791
Joined:  2008-05-26
Dublin
 

finally
got 0.365s average for page load!
Nginx rules!!

2 months worked with nginx config, and now we have it right…

 
Magento Community Magento Community
Magento Community
Magento Community
 
rsskga
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-15
San Francisco
 

How can nginx be set up with multiple sites/domains?

Nginx instructions are not listed here: http://www.magentocommerce.com/wiki/multi-store_set_up/multiple-website-setup

 
Magento Community Magento Community
Magento Community
Magento Community
 
drico
Jr. Member
 
Total Posts:  2
Joined:  2007-08-31
 

Hi,
First of all, is it possible to set up nginx in multi-store configuration ?

I noticed that the community edition (single store) and enterprise edition runs on nginx but not the community multi-store demo, which runs under apache 2.2.3
what does it mean?

D.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rsskga
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-15
San Francisco
 

I haven\’t sorted out multi-store config yet, but did resolve a problem I was having with a single store…

clockworkgeek\’s nginx config instructions (http://www.magentocommerce.com/boards/viewthread/7931/#t211050) were super, super helpful to me. My site seemed fine, however I started noticing in my Google Analytics reports that many visitors were bouncing from URL\’s like so:
http://store.com/product-url-path/index.php

This was because product pages with /index.php appended were resulting in a blank white screen with the error message \’No input file specified.\’ Nothing in the error log. I googled the heck out of this, and found suggested solutions ranging from ensuring that nginx and php config paths were correct, to launching php with the correct user/group permissions, etc. None of these suggestions helped me at all.

So… it may be a hack, and maybe I really do need to fix something with my server… but I deduced that I could fix the problem for now with rewrites. Here is the line I added to my nginx domain.conf.

location ~ /(.*)/index\.php## strip index.php from product urls
        
if (!-e $request_filename{ rewrite ^(.*)/index\.php$ $1permanent
}

Hope this helps someone else!

I am still getting these errors… If anyone can shed some light I\’d appreciate it. (I have SSL on.)
[warn]: conflicting server name \"domain.com\" on 0.0.0.0:80, ignored
[warn]: conflicting server name \"domain.com\" on 0.0.0.0:443, ignored

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kammalou
Sr. Member
 
Avatar
Total Posts:  285
Joined:  2009-01-20
Denmark
 
Turnkeye.com - 20 April 2010 01:14 AM

monocat - 19 April 2010 02:26 PM
samm - 02 April 2010 01:34 PM
A long time ago btw. Now we are running on latest stable with some local modifications.

Samm- who are you hosting with?

I sure they use dedicated servers, NginX optimized.

nginx is very usefull in some scenarios. Also when looking at magento.
But you are infact also able to implement quite fast magento sites running Apache / mod_php / Plesk.

We have Magento Enterprise 1.8 Running as part of a shared environment in such setup doing >1500 Transactions pr. second with fullpage caching enabled.

On other dedicated magento installations where the memory is an issue we would use nginx for minimizing the memory footprint.

My point is: Chose _the_ product that adds the most value to your clients ebusiness. And forget the software fundamentalism.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kammalou
Sr. Member
 
Avatar
Total Posts:  285
Joined:  2009-01-20
Denmark
 
powerdude - 02 July 2010 09:44 AM

finally
got 0.365s average for page load!
Nginx rules!!

2 months worked with nginx config, and now we have it right…

we have <0.03s with apache/mod_php/plesk
wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
clockworkgeek
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-31
 

Sorry for not replying months ago, I was not watching this thread.

rsskga - 09 July 2010 01:07 PM

How can nginx be set up with multiple sites/domains?

Nginx instructions are not listed here: http://www.magentocommerce.com/wiki/multi-store_set_up/multiple-website-setup

Probably you are using version 1.4 which as the linked article explains, has a different way of doing things. When I wrote my original post I was still on 1.3 and I didn’t need to consider environment.

In researching what to do I saw this post from around the same time as your post, it might even have been you! The answer it gives is essentially right, the trick is to apply “fastcgi_param” directives. To keep things clear I have started a wiki.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3