nginx (pronounced "engine-x") is a lightweight, high-performance Web server and reverse proxy as well as IMAP/POP3 proxy server.

learn more… | top users | synonyms

2
votes
1answer
3k views

403 Forbidden error on Mac OSX - Apache and nginx

There are a million questions like this on Google, but I haven't found a solution to my problem. The default Apache install on my Mac is giving 403 Forbidden errors for everything (default directory, ...
2
votes
1answer
2k views

Mixed IP and Name Based Virtual Hosts with nginx

I set up many domains but I dont know how to configure if only ip address is given. say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to ...
2
votes
1answer
835 views

Configure nginx to serve a 503 if a file exists

I'm trying to setup nginx to return a 503 if a particular file exists (probably something like "upgrading"). I'm trying to use the try_files directive, but when it finds the /upgrading.html file, it ...
2
votes
2answers
3k views

nginx better than apache for dynamic content? [duplicate]

Possible Duplicate: Apache or NGINX for PHP? Hi, i have searched for this around the web and i can't find the right answer for my question. basically i want to know if i can get better ...
2
votes
1answer
5k views

nginx- Rewrite URL with Trailing Slash

I have a specialized set of rewrite rules to accommodate a mutli site cms setup. I am trying to have nginx force a trailing slash on the request URL. I would like it to redirect requests for ...
2
votes
1answer
1k views

How soon does nginx's token bucket replenish when limiting at requests per minute?

We've decided that we want to experiment and limit requests per minute instead of requests per second on our sites. However, I am confused by the burst parameter in this context. I am under the ...
2
votes
3answers
1k views

Determine nginx reverse-proxy load limits

I have an nginx server (CentOS 5.3, linux) that I'm using as a reverse-proxy load-balancer in front of 8 ruby on rails application servers. As our load on these servers increases, I'm beginning to ...
2
votes
2answers
624 views

my first “production” debian server configuration

I have been using Debian for a year, mostly as the distro for my internal company server. Now I am making a public e-commerce website and I am planning to use a dedicated Debian server at a datacenter ...
1
vote
0answers
204 views

Improving TCP performance over a gigabit network lots of connections and high traffic for storage and streaming services

I have two servers, Both servers hardware Specification are Processor : Dual Processor RAM : over 128 G.B Hard disk : SSD Hard disk Outging Traffic bandwidth : 3 Gbps network cards speed : 10 Gbps ...
1
vote
1answer
2k views

nginx + php fpm -> 404 php pages - file not found

*2037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream server { listen 80; ## listen for ipv4; this line is default and implied #listen ...
1
vote
2answers
2k views

nginx deny user agent causes error when not encapsulated in quotes

I'm trying to deny some user agents I constantly see probing my nginx web server. If I have this in my .conf file ## Block http user agent - morpheus fucking scanner ## if ($http_user_agent ~* ...
1
vote
1answer
1k views

Cannot access any svn file

I put directory svn and svn-auth in /var/www and already change owner and set permission with chown -R apache.apache /var/www/svn* and chmod 600 -R /var/www/svn* My configuration ...
1
vote
3answers
2k views

NGINX sub domain proxy pass

Version: nginx/1.2.0 || (I know the risks, its for a internal server) How would I setup a system where 17.hostname.com would be put as proxy_pass http://192.168.56.17:80 (Where 17 would be replaced ...
1
vote
3answers
3k views

Blocking 'good' bots in nginx with multiple conditions for certain off-limits URL's where humans can go

After 2 days of searching/trying/failing I decided to post this here, I haven't found any example of someone doing the same nor what I tried seems to be working OK. I'm trying to send a 403 to bots ...
1
vote
3answers
6k views

Nginx serving content from the wrong “virtual host” while accessing with https

I have a server running both Nginx and Apache in a proxy setup, Nginx serves the static content and Apache the dynamic content which works really well. This setup is currently hosting two versions of ...
1
vote
1answer
3k views

Hide path to backend with Nginx

I have OpenNMS running on host B-beta with the following URL: http://b-beta:8980/opennms I would like to use NginX to hide this path accessible from host a-alpha like this: ...
1
vote
2answers
2k views

nginx proxy pass redirects ignore port

So I'm setting up a virtual path when pointing at a node.js app in my nginx conf. the relevant section looks like so: location /app { rewrite /app/(.*) /$1 break; proxy_pass ...
1
vote
2answers
3k views

How do you conditionally include files in Nginx vhost?

In the lines below, I might have a site-specific configuration file that contains additional fastcgi_params unique to that site. If this file exists I want to load it. server { listen 80 ...
1
vote
2answers
1k views

Nginx, awstats and request time

How can I tune nginx to write request time to logs such that awstats can show time taken for each request? Also, how can I see requests by time taken in awstats? This is the current format ...
1
vote
1answer
400 views

How to make nginx remap a part of the URL without sending a redirection?

I have pictures on a path looking like this: /0/1/2/3/4/01234/screenshots/1.jpg The URL to access it looks like this: /static/0/1/2/3/4/01234/screenshots/1.jpg I'd like it to look like this: ...
1
vote
2answers
489 views

Awstats logformat typo?

I've been through the awstats docs for a while now, it just seems to be failing with the Logformat. I'm using the following in awstats, LogFormat = "%host - - %host_r %time1 %methodurl %code %bytesd ...
1
vote
3answers
5k views

nginx errors: upstream timed out (110: Connection timed out)

I have a nginx server with 5 backend servers. We serve around 400-500 requests/second. I have started getting a large number of Upstream Timed out errors (110: Connection timed out) Error string in ...
1
vote
4answers
225 views

Does Nginx need a unique ip address for every site served over HTTPS like Apache?

With Apache's the most common HTTPS setup you need 1 IP Address per site. Does Nginx have this same limitation or can a single IP Address serve an unlimited number of HTTPS sites?
1
vote
2answers
2k views

Nginx wont send POST to FastCGI backend, but GET works fine?

Not sure why, but it is happy sending a GET to the FastCGI backend (Mercurial hgwebdir in this case), but simply resorts to the filesystem if the request is a POST. Relevant parts of nginx.conf: ...
1
vote
5answers
2k views

How can I prevent hotlinking? (nginx)

I use nginx and I have no access to server conf. May be with .htaccess analogue?..
0
votes
2answers
418 views

Can't get php-fpm with Nginx to work

Server: CentOs x86_64 /etc/php-fpm.d/webuser1.conf [webuser1] listen = 127.0.0.1:9001 listen.allowed_clients = 127.0.0.1 user = webuser1 group = webuser1 pm = dynamic pm.max_children = 15 ...
0
votes
1answer
120 views

Nginx as a reverse proxy + Apache or completely cut out Apache? (WordPress Multisite)

I am starting a WordPress multisite network with domain mapping and I am trying to think through my server set up. Right now, I only have one medium sized VPS but hopefully I will need to add more ...
0
votes
1answer
558 views

How to prevent nginx from locking files on mounted samba partition in Centos 6

I'm using nginx 1.3.8 inside a centos 6.3 virtualbox 4.2.4 virtual machine. The system is running the latest software available via yum update. The host OS is windows 7. The site files nginx is ...
0
votes
1answer
9k views

How do I change the NGINX user?

I have a PHP script that creates a directory and outputs an image to the directory. This was working just fine under Apache but we recently decided to switch to NGINX to make more use of our limited ...
0
votes
2answers
351 views

Nginx how to disable multithread downloads

I was wondering if its possible to disable multithread downloads on nginx. Right now users can use download managers to download a file by splitting a file and I was wondering how I can prevent that ...
0
votes
4answers
3k views

How can I create a location in nginx that works with AND without a trailing slash?

Right now, I have this: location ~ ^/phpmyadmin/(.*)$ { alias /home/phpmyadmin/$1; } However, if I visit www.mysite.com/phpmyadmin (note the lack of trailing slash), it won't find what I'm ...
0
votes
1answer
891 views

nginx dynamic virtual hosts

With nginx is there a method to setup mass dynamic virtual hosts similar to the way apache2 can be configured? I'm setting up an saas application each user will have their own subdomain and i'd like ...
0
votes
1answer
489 views

Add www to non-www address with ssl

I would like all traffic without the www, including https, to be redirected to the respective url with the www. So http://example.com -> http://www.example.com, https://example.com -> ...
0
votes
1answer
1k views

What IP does nginx use for ip_hash sticky sessions?

Does nginx use the direct client's IP for ip_hash, or does it also observe X-forwarded-for HTTP header to use as the IP address to ip_hash? For example, in a situation where some clients using a ...
0
votes
2answers
823 views

nginx not acknowledging passenger_root option

I'm running a sinatra app on passenger, and trying to hook it to nginx. The relevant part of my config looks like: http { passenger_root /path/to/gem; #this is a valid path passenger_ruby ...
0
votes
3answers
4k views

Why is it necessary to chmod o+r parent directory to fix 403 access forbidden error with Nginx and Passenger?

This may be an Nginx wrinkle, or it may be because I don't understand Unix permissions. We're using Hudson CI to deploy our staging instance. So RAILS_ROOT is /var/lib/hudson/jobs/JOBNAME/workspace. ...
6
votes
3answers
2k views

nginx: optimum # of workers

I just bought a new server which will be running nginx, PHP, MySQL stack that will be serving fully-cached html requests 90% of the time and PHP/mysql requests otherwise through FastCGI. Stats on the ...
4
votes
1answer
688 views

Status code in nginx try_files directive

Is it possible to use the current status code as a parameter in try_files? For example, we try to provide a host specific 503 static response, or a server-wide fallback if it wasn't found: ...
4
votes
1answer
2k views

How to extract Only the file name from the request uri

I am trying to rewrite the request uri depending on the extension of the file, then extract only the file name from the uri and store it in another folder. The problem here is no predefined variable ...
3
votes
2answers
366 views

select() hangs due to resource exhaustion - but what resource?

Connecting to my server via sftp sometimes results in a hang here: if (select(max+1, rset, wset, NULL, NULL) < 0) { which is line 1428 from openssh 5.2p1's sftp-server.c (main loop of ...
3
votes
2answers
5k views

Why is my nginx alias not working?

I'm trying to set up an alias so when someone accesses /phpmyadmin/, nginx will pull it from /home/phpmyadmin/ rather than from the usual document root. However, everytime I pull up the URL, it gives ...
3
votes
4answers
758 views

Nginx. How do I reject request to unlisted ssl virtual server?

I have a wildcard SSL certificate and several subdomains on the same ip. Now I want my nginx to handle only mentioned server names and drop connection for others so that it'd look like nginx is not ...
3
votes
3answers
4k views

nginx HTTPS WWW redirect to non-WWW

My SSL certificate is for mydomain.com, so i am trying to redirect all www.mydomain.com over to without www. Now, all these work: http://www.mydomain.com http://mydomain.com https://mydomain.com ...
3
votes
5answers
1k views

Which Is a Good Starting Point For Beginner? Apache, Nginx or Cherokee?

Any of these web server software i.e., Apache, Nginx and Cherokee is suitable for my website at the moment. And I am learning sysadmin to be able to manage my server (and not for a job). For a ...
3
votes
1answer
1k views

How do I DRY up this Nginx configuration?

I’m on Nginx 0.8.54 trying to achieve the following as DRYly as possible: Proxy straight to localhost:8060 if cookie no_cache is true or if request method isn’t GET. Otherwise serve static files ...
3
votes
3answers
2k views

Load balancing: Nginx, Varnish and HTTP sessions

I have to setup a load balancing system. At the moment I have two machines running Nginx 0.8.52, PHP-FPM (on unix socket) and an application based on PHP Symfony 1.4.11. On a third machine, I have to ...
3
votes
2answers
796 views

What's the best server to use with ASP.Net on Mono? [closed]

I am reconfiguring my website from scratch and basically I want it to run Mono(well, ASP.Net inside Mono) According to the Mono Project there appears to be two options, Apache or Nginx. Which one ...
3
votes
2answers
3k views

Nginx: Forward all Subdomains

My code doesn't work with second level tld's like domain.co.uk Here is my conf: # add www. if ($host ~ ^(?!www)) { rewrite ^/(.*)$ http://www.$host/$1 permanent; } # remove subdomain ...
3
votes
3answers
3k views

Nginx rewrite urls without redirection

I used rewrite directives below in nginx to rewrite urls of static files to external CDN server. rewrite ^/static/(css|images|js)/([a-z_\-\.]+)$ http://cdn.domain.com/$1_$2 last; It works but it ...
3
votes
5answers
2k views

nginx vs lighttpd for wordpress

Which web server would be more suitable for running a few instances of wordpress? They are both pretty easy to setup, so I am wondering mostly about performance. Would there be a difference? I think ...