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

11
votes
3answers
1k views

The downsides of using nginx as a primary web server?

I've seen millions of websites using nginx as a proxifying webserver working together with Apache. But I've seen very few servers running nginx only as their default webserver. What are the main ...
10
votes
5answers
11k 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 ...
9
votes
3answers
27k views

nginx fastcgi “Primary script unknown” when configuring userdir

I hate configuring nginx. It's so complicated. How do I get PHP to work in my user dirs? Here's the relevant part of my nginx.conf: location ~ ^/~(.+?)(/.*)?$ { autoindex on; ...
7
votes
2answers
12k views

Understanding this error: apr_socket_recv: Connection reset by peer (104)

So, if I do some benchmarking with apache benchmark (ab), and I use large numbers of requests. Then sometimes in the middle of a test I get this error. I don't even know what it means. So how can I ...
6
votes
1answer
7k views

How do I set a default host for nginx?

I'm trying to figure out how to set a default host for my nginx installation. I found this article in the nginx Wiki: http://wiki.nginx.org/NginxVirtualHostExample#A_Default_Catchall_Virtual_Host ...
6
votes
7answers
5k views

Handling http and https requests using a single port with nginx

i was wondering if nginx is able to handle http and https requests on the same port. [*] This is what i'm trying to do. I'm running a web server (lighttpd) handling http requests, and a C program ...
5
votes
1answer
717 views

add_header directives in location overwriting add_header directives in server

Using nginx 1.2.1 I am able to add multiple headers using add_header as follows: server { listen 80; server_name localhost; root /var/www; add_header Name1 Value1; <=== ...
5
votes
1answer
4k views

Working Nginx fastcgi_cache php-fpm cache and static file caching configuration?

Nginx wiki is very vague with explanation as to how to properly setup nginx with php-fpm with fastcgi_caching for sites which have cookies i.e. wordpress, drupal, vbulletin etc. I downloaded a ...
5
votes
1answer
4k views

Blank Page: wordpress on nginx+php-fpm

Good day. While this post discusses a similar setup to mine serving blank pages occasionally after having made a successful installation, I am unable to serve anything but blank pages. There are no ...
4
votes
2answers
6k views

Nginx - How to redirect users with certain IP to special page

I run quite a big image gallery and there are 5 visitors that create an enormous amount of traffic by downloading the whole site every day using webcopiers. Those visitors have static IPs as it seems. ...
4
votes
4answers
3k views

What are the Differences between HAProxy and Ngnix in reverse proxy mode?

What are the differences between HAProxy and Nginx when it comes to their abilities as a reverse proxy?
3
votes
1answer
5k views

How to use nginx as reverse proxy with multiple IPs and SSL?

I would like to setup nginx reverse proxy with multiple domains and an IP for each of them to use different SSL Certs. I run Ubuntu as OS which is installed on a KVM/Qemu VM. As I understand nginx, ...
3
votes
1answer
3k views

Nginx - basic http authentication on PHP-script

I added a PHP-Script that serves as "cgi-bin", Configuration: location ~^/cgi-bin/.*\.(cgi|pl|py|rb) { gzip off; fastcgi_pass 127.0.0.1:9000; fastcgi_index cgi-bin.php; ...
3
votes
3answers
6k views

Can Nginx handle php (or similar fcgi) requests inside of an alias?

I am converting a legacy Apache server to Nginx and do not have the luxury of changing URL's or rearranging the filesystem. Is it possible to use nested location{} blocks in the Nginx configuration ...
2
votes
3answers
1k views

Use HAProxy or Nginx to Load Balance between VPS

I want to load balance + failover backup multiple vps webservers hosted on different providers. I heard that for HAProxy you need multiple server under the same subnet, plus a shared (virtual) ip ...
2
votes
1answer
484 views

Is it possible to configure Nginx to allow for new domains to be added without me having to add a VirtualHost for each?

I have a SaaS application wherein users can enter their domain names. The application uses the hostname of incoming requests to determine the account based on the domain they entered for their ...
2
votes
5answers
11k views

How do I make Nginx redirect all requests for files which do not exist to a single php file?

I have the following nginx vhost config: server { listen 80 default_server; access_log /path/to/site/dir/logs/access.log; error_log /path/to/site/dir/logs/error.log; root ...
2
votes
4answers
2k views

nginx logrotate config

Whats the best way to rotate nginx logfiles? In my opinion, I should create a file "nginx" in /etc/logrotate.d/ and fill it with the following code and do a /etc/init.d/syslog restart after that. ...
2
votes
5answers
5k views

Curl development headers with SSL support for Phusion Passenger 3

I'm trying to install phusion passenger nginx module, but it fails # passenger-install-nginx-module * Curl development headers with SSL support... not found ... yum install curl-devel Setting up ...
2
votes
6answers
3k views

Get list of user-agents from nginx log

I have nginx log file, and I want to find out market share for each major version of browsers. I am not interested in minor versions and operating systems. I would like to get something like this: ...
1
vote
2answers
460 views

Is it possible to balance load between multiple Nginx load balancers without using a hardware load balancer?

I plan to balance load between my app servers using a separate Nginx server as a software load balancer. But actually, it's because a load balancer in front of the app servers allows me to update an ...
1
vote
1answer
144 views

Set global handling for PHP scripts in NGINX + PHP-FPM

I have to define fastcgi_pass for every virtual host. How do I define it global-wise? server { listen 80; server_name www.domain.tld; location / { root ...
0
votes
1answer
3k views

PHP Errors (via FastCGI) with Nginx on Ubuntu Linode

I setup LEMP (Linux, Nginx, MySQL, and PHP) on a Ubuntu 10.04 server from Linode with the following guide: http://library.linode.com/lemp-guides/ubuntu-10.04-lucid Essentially, I uploaded my PHP ...
9
votes
2answers
782 views

API Management Solutions [closed]

I'm currently building an API and am looking for a tool to allow me to monitor (in a GUI) and rate-limit usage. I've come across a few enterprise solutions including: http://apigee.com/ ...
7
votes
3answers
776 views

nginx: How to prevent an exactly named SSL server block from acting as the catchall for all SSL

I have a web server with many virtual servers. Only 1 of which is SSL. The problem is, because there is no catchall server block listening for SSL, any https request to the other sites is served by ...
6
votes
1answer
2k views

Nginx : strip header on HTTP, add header on HTTPS

I'm configuring an Nginx server so as to serve as a reverse proxy to serve a Django app (run on Gunicorn). My problem is that I want my site secured with HTTPS, and so I want my Django app to be able ...
6
votes
1answer
2k views

Use Nginx to server different pages depending on IP address/subnet

For reasons to hideous to go into... I'm using Nginx as a webserver and would like it to serve one page for internal users (say on 10.0.0.0/16) and another page to external users on any other IP ...
6
votes
3answers
4k views

Mapping hudson to a subdomain through nginx proxying

I'm now trying to setup nginx as a reverse proxy for Hudson so it can be access on http://build.example.com directly. I've already installed Hudson on Tomcat and verified that I can access Hudson on ...
6
votes
1answer
1k views

What causes a 400 Bad Request error for null (“”) and why would our nginx logs have so many?

Daily logs from Logwatch regularly report 400 Bad Request, null: 1744 Time(s) from our nginx logs. The log entries look like: 123.123.123.123 - - [25/Jan/2011:14:44:19 -0500] "-" 400 173 "-" "-" ...
6
votes
4answers
5k views

Nginx + PHP 5.3.3 (with php-fpm) - memory usage?

I recently bought Xen VPS (linode.com) with Debian 5.0 Lenny (i386), 512MB RAM. At the moment I have only three small websites (built with Drupal) with about 600 users per day in total running on this ...
5
votes
3answers
483 views

How to replicate nginx data to two servers?

I'm trying to replicate the traffic that one specific nginx server receives to two servers. The goal is not to load-balance, but to replay the same input on all nginx servers. An example: Nginx ...
5
votes
2answers
581 views

nginx clobbering sftp traffic during peak times - is tc the answer?

This is probably a continuation of my previous (unanswered) question because the underlying cause is probably the same. I have a Linux server with nginx and sshd running on it. It's on a shared ...
5
votes
2answers
319 views

Why might a 413 not be flushed to the client immediately?

I have my local development server returning status 413 for oversized file uploads and the client is receiving these immediately - as I require. My remote server is the same version of Nginx and ...
5
votes
1answer
2k views

NGINX convert HEAD to GET requests

Due to some terrible design decisions, we have an application unable to respond to HTTP HEAD requests (Returns 'Method Not Allowed'). Modifying the software to return HEAD requests correctly would be ...
5
votes
4answers
3k views

limit bandwidth and space usage of each Virtual Host?

I am starting a small web hosting company to teach me about system administration and one of the problems I am having is how would I limit the bandwidth and disk space of each virtual host ...
4
votes
1answer
314 views

Heartbleed, which specific services must be restarted?

Trying to figure out exactly what services should be restarted after patching openssl against Heartbleed. At least one post mentions restarting: sshd, apache, nginx, postfix, dovecot, courier, ...
4
votes
3answers
1k views

Could this server log mean my server is being used as a proxy?

I came across the following entry in my access.log: 58.218.199.147 - - [05/Jun/2012:12:56:04 +1000] "GET http://proxyproxys.com/ HTTP/1.1" 200 183 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT ...
3
votes
2answers
318 views

Why put a reverse proxy in front of a WSGI server?

A typical configuration for deploying a WSGI application includes a WSGI server (such as uWSGI or Gunicorn) behind a general-purpose web server (like nginx) that acts as a reverse proxy. One major ...
3
votes
2answers
2k views

Nginx $document_root$fastcgi_script_name vs $request_filename

I can't notice any difference if in my config file I set fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; Or: fastcgi_param SCRIPT_FILENAME $request_filename; What do ...
3
votes
3answers
988 views

Is it possible to route requests to different applications via Content-Type?

I'm designing a JSON API, and I'd like to version the API using content negotiation of some kind. I'm currently planning on using Vendor MIME Types to do this. While I can definitely do this at the ...
3
votes
2answers
1k views

PHP-Mcrypt Installation

I need to install php-mcrypt on my CentOS 5.5 VPS, When I try yum install php-mcrypt, it says that it is set to be updated which implies that it is already installed. I looked in the ...
3
votes
1answer
7k views

How to permanently redirect port 8080 URL to port 80 using nginx

Because of my carelessness, I put http://www.domain.com:8080/xxx/index.html on the internet. I don't want to lose that traffic, so i want to permanent redirect that url to ...
2
votes
2answers
167 views

Forward all TLD requests to another server

So, an emergency has been landed in my lap, and unfortunately I'm ill-equipped to deal with it. An IT tech for a client's company changed the A record for a domain, then went on holiday. He is the ...
2
votes
2answers
745 views

How do I reserve bandwidth for rsync?

Currently nginx uses all my bandwidth. How do I leave some for rsync?
2
votes
3answers
2k views

How to add a pool to FPM (nginx) without reload/restart fpm itself?

Im building an environment (on a ubuntu 10.04.02 machine) to handle a website with many (should support at least 1000) subdomains, each of them served by a different FPM pool, with a different user. ...
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
810 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 ...