Nginx ("engine x") is a lightweight, high-performance HTTP server, reverse proxy, TCP stream proxy and mail proxy, released under a BSD-like license.

learn more… | top users | synonyms

2
votes
1answer
1k views

High memory usage by apache after server switch

Recently moved to a new server with CentOS 5.4 and is 64 bit as opposed to our old 32-bit. It's got dual processors now and a bit higher memory. I realized though, that apache has been heavily eating ...
2
votes
2answers
4k views

nginx redirect to another domain not forgetting about the subdomains

this is rather a quick one: How do I redirect to another domain and still forward the subdomain? Example: http://foo.domainone.com/bar.php -> http://foo.domaintwo.com/bar.php Thanks in advance!
2
votes
1answer
2k views

nginx regex characters that require quoting?

So I was configuring nginx today and I hit a weird problem. I was trying to match a location like this: location ~ ^/([0-9]+)/(.*) { # do proxy redirects } ...for URLs like ...
1
vote
0answers
523 views

How are these AB Benchmarks for a ruby/unicorn/nginx/ app running on ec2?

I am preparing to go live with an app, and was wondering if someone can give me some insight on my benchmarks. How do they compare, what system level tweaks can I make to improve them etc. My setup ...
1
vote
1answer
752 views

configuring nginx and tomcat together

I am trying to figure out exactly how to configure nginx and tomcat to work together correctly. Nginx has a worker connections setting and tomcat has max threads (assuming native apr connector for ...
0
votes
2answers
248 views

What email service would work best in this scenario? [duplicate]

Possible Duplicate: Recommended SMTP Relay Service I am using a VPS server at Linode to host a few Drupal websites. For web I am using Nginx, and all email is hosted with Google Apps. I ...
0
votes
1answer
1k views

How can I rewrite HTML at the HTTP server level?

I'm building a personal website using Nginx and I'd like to have the option of serving the same content over both HTTP and HTTPS. However, the content management system I'm using stores a lot of the ...
1
vote
1answer
295 views

nginx block request for ip number

I'm using nginx. If my ip numbers are 1.2.3.4 and 1.2.3.5, how can I configure it to block requests for the ip numbers and only allow domains. If site1.com is configured for 1.2.3.4, I want to ...
10
votes
4answers
22k views

How to disable Nginx logging?

I have the following in config file server { listen 80; server_name _; access_log /var/log/nginx/access.log main; ... server { listen 80; server_name ...
1
vote
1answer
150 views

nginx virtual hosting wildcards

I have one ip number to use, 1.2.3.4 and want to share it with several domains. I have site1.com separate, but the other domains I have a script to display content based on the domain. I've moved to ...
1
vote
2answers
475 views

domain name cloaking with nginx

How can I do the following in nginx? I have a website hosted on example.com/id/44, I want to have my domainname test.com linked to that url. I also want that the domain name in the url sticks to ...
0
votes
2answers
137 views

Subdomain does not tail directory on nginx

I'm trying to make the subdomain work when accessing to dev.domain.com, it should tail to the /var/www/domain.com/www/dev where /var/www/domain.com/www/ is the root of domain.com. When I access to ...
1
vote
3answers
130 views

What's a common mechanism for emailing in the background?

When users sign up to my site, the connection from my server to our 3rd-party SMTP provider is very bad and the app takes from a few seconds to a few minutes to connect. While it is trying to connect ...
2
votes
3answers
1k views

Why Remove Shell Access for the Apache/Nginx User?

Is it a bad idea to grant shell access to the user account destined to be running Apache/Nginx? I ask because, the Guvnr, in his VPS Bible series, sets up a new user with visudo'd guvnr ALL=(ALL) ...
0
votes
2answers
1k views

Proxying from nginx to Jetty

I'm proxying request from nginx to Jetty, but I have problem with request that Jetty receives. Jetty requests shows that request IP address is 127.0.0.1. But I want real server IP and my site has ...
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
3k views

Nginx try_files gotcha

Ok - i've been using this rule for a while location ~* /(?:abc12345|12abcdef)/(.*\.(jpe?g|gif|png)) { alias /usr/local/image/$1; error_page 404 /handler.php; } where if the image file ...
0
votes
2answers
129 views

nginx proxy GET to one server, GET & everything else on another one

I have a new version of our app and it needs to be tested before placed everywhere in production. There is one main machine that currently receives all requests and forwards them to an Apache using ...
2
votes
3answers
6k views

How do I alias a name in nginx w/o aliasing the domain name?

I have this line in my config file server_name site.com m.site.com My code checks if the url is m.site.com and serves the mobile version. However when I do this going to m.site.com/abc will show my ...
0
votes
5answers
1k views

nginx wordpress permalinks day and name

hello everyone :) I am new to nginx and I am trying to setup the wordpress permalink structure that would normally be added to the .htaccess files. here is the old rewrite rule from .htacces # ...
0
votes
3answers
537 views

Debian Nginx virtual hosts not found / unavailable

Following this tutorial and this followup I have a fresh Nginx + PHP5-FPM setup on Debian 6 (Squeeze) running on an OpenVZ VPS. Right now the default virtual host works (Welcome to nginx! is ...
1
vote
0answers
709 views

nginx stuck and setting CLOSE_WAIT when using worker_processes > 1

Everything works nicely if I have worker_processes=1, or I run one request at a time. If I open a browser on a fresh nginx install and holds F5 down a couple of seconds, the sockets gets lingering as ...
3
votes
2answers
11k views

nginx: multiple document roots with fastcgi

When using a single document root in my http directive, everything works fine. However, I want to add a location directive with an additional directive and I can't get fastcgi to work with this ...
1
vote
2answers
679 views

Nginx: Serve sitemap.xml compressed, gzipped once but invalidate when changed from backend

I have a sitemap.xml that runs in 1.5 GB. How do I serve that sitemap.xml compressed from nginx such that it will be compressed only once and then served? Probably using caching too (if possible) ...
1
vote
1answer
167 views

Nginx location directive and php scripts

I have an issue with an Nginx location directive. I need to be able to send any URI through fastcgi so that it ends up in a PHP framework. But I also want to set up a rule whereby any URI beginning ...
2
votes
1answer
359 views

How do I get Apache stats into munin when proxied from nginx?

I have munin plugins for mysql and nginx working, but, I'm not sure how to get the apache plugin working (it's there, I just haven't setup apache yet). nginx proxies requests to apache running django ...
0
votes
2answers
750 views

Can mono/xsp with fastcgi handle more then one request?

Right now i am using nginx with mono/xsp through fastcgi. I haven't seen any clear answers but can xsp/fastcgi handle multiple request? I have one instance running all my sites. Would i get better ...
6
votes
2answers
12k views

nginx: how do I track down a random 500 from nginx (not my application). Potentially has something to do with load?

We recently had some 500's from nginx itself that somehow were not logged (we have screenshots, but nothing in the logs). That is weird in itself, because usually errors show up there. Regardless, I ...
38
votes
4answers
125k views

connect() failed (111: Connection refused) while connecting to upstream

I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this: 2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed ...
1
vote
2answers
1k views

When accessing PHP files, nginx throws an 404 error

Right, sorry for the previous, recent questions I've asked about nginx, this is just doing my head in. I've enabled PHP using fastcgi_php and it works just fine, however, when I access to a PHP file, ...
5
votes
5answers
14k views

How to install nginx and install the configuration files too

I've just completely uninstalled nginx 1.0.6 from my server (Ubuntu 11.04) using apt-get remove nginx rm -rf /etc/nginx/ rm -rf /usr/sbin/nginx rm /usr/share/man/man1/nginx.1.gz apt-get remove ...
2
votes
2answers
1k views

Block IPs that try to exploit common webapp vulnerabilities

Is there an application that goes through the nginx logs and blocks IPs that made requests for common webapp vulnerabilities? I have an nginx web server that serves only static content. I routinely ...
3
votes
2answers
1k views

How to create this type of subdomain: example.test.domain.com

I've managed to find a rewrite for making subdomains (which I have a wildcard domain pointed to my server; *.domain.com. If I go to test.domain.com, it works just fine which transverse to: ...
0
votes
1answer
495 views

Daemonizing tool for Gunicorn Centos Nginx and Django

I have set up a basic centos server and through that tested certain technologies. Currently I am running django-1.3, Nginx with FastCGI - works like a charm I have noticed that as soon as my latest ...
3
votes
1answer
2k views

502 Bad Gateway error after failed requests using Passenger

I've got a staging server running nginx 1.0.5 using Rails 3.1 under Passenger 3.0.9. The problem is that a request sent just after one where there's an application error return 502 Bad Gateway. To ...
3
votes
2answers
8k views

check several user agent in nginx

I need to redirect the traffic to one backend or another according to the user-agent. Is that the right thing to do ? server { listen 80; server_name my_domain.com; if ...
0
votes
2answers
756 views

Is it possible to filter/edit web content using Apache/Nginx/Lighttpd?

Is it possible to use any of the following HTTP servers: Apache, Nginx or Lighttpd as a proxy to make the following: Disallow certain HTTP bodies (web pages) based on their content (e. g., words) ...
2
votes
1answer
1k views

Weird 404 issue with nginx 's.png'

This URL is invalid: http://mysite.co.uk/assets/images/whymysite/viewoptions.png However, if I replace the 's' at the end before .png, with ANY other standard character (that I've tried so far, it ...
1
vote
4answers
471 views

nginx rewrite specific sub domains

I am trying to rerwrite any sub domains outside of an approved list i.e. (dev,test,home).domain.com here is what I am working with now: #rewrite all sub domains if ($host ~* ...
13
votes
4answers
11k views

How do I configure Nginx proxy_pass Node.js HTTP server via UNIX socket?

I am trying to configure a Nginx server to connect to a Node.js HTTP server via a UNIX domain socket. The Nginx configuration file: server { listen 80; location / { proxy_pass ...
0
votes
1answer
294 views

ubuntu server monitoring and troubleshooting

I have a rackspace cloud server running Ubuntu 10. The http font-end is nginx 1.0.2. There are multiple java web app instances running on Play!Framework, which in turn built on Netty stack. I found ...
1
vote
1answer
193 views

Nginx: location directive for sub domains under a single server

I have a server config like this server { listen 80; server_name www.site.com; server_name stage.site.com; server_name nagios.site.com; location ~* (.*)nagios { ...
0
votes
1answer
123 views

nginx redirecting for no reason?

This was really annoying and now i see when it happens. If <ip>/NAME exist in /var/www (/var/www/NAME) nginx will give me a redirect to www._.com/NAME/ (note the slash and lack of url) which is ...
2
votes
1answer
171 views

How to reduce Nginx tasks running under php-fpm?

What is Apache's mod_php equivalent in Nginx? I have Nginx with php-fpm. Everything is perfect but the problem is that it works like fcgi in Apache not mod_php. This means that a task is added for ...
1
vote
1answer
662 views

NGINX and php_fpm streaming file takes triple in transfer?

My setup: - nginx 1.0.6 ( compiled from scratch ) - php 5.3.8 with php-fpm ( also from scratch ). I use this PHP script to stream files from the remote site to my users: $chunksize = 1 * ...
5
votes
1answer
2k views

Nginx reverse proxy: Not setting expires header

I have my static assets configured as location @upstream { proxy_pass http://localhost:82; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; ...
12
votes
5answers
22k views

Why are my PHP files downloading instead of processing with Nginx

I have seen the same problem, and many resolutions for it pointing to adding the type handler, but that was for Apache. I am using Arch Linux, Nginx, PHP and PHP-FMP and I cannot figure out why php ...
1
vote
0answers
795 views

Nginx+Pfsense+IIS+NLB: upstream timed out (110: Connection timed out)

We have an Nginx Reverse Proxy (RP) bound to one IP, that load-balances/fails-over to two IPs that are located roughly 140ms away, by network time. Each of these upstream IPs are on different ISPs, ...
8
votes
3answers
3k views

Nginx proxy_pass response truncated

I use nginx to proxy https request to my application server (currently running on 8443). This app server serves dynamic pages, some of them including jquery minified. The pages are in error as it ...
1
vote
1answer
2k views

Nginx + PHP-FPM 4GB Ram optimization

So I have it all running, no errors, but I'm trying to optimise it for a 4gb Rackspace Cloud server. This is what I have currently: php-fpm.conf pm.max_children = 200 pm.start_servers = 20 ...