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

1
vote
2answers
3k views

Allow www-data to execute shell script

I have a shell script called boot.sh on an Ngnix server I am trying to call it via PHP, but I don't think I have permissions. How can I give www-data permission to run boot.sh - and only boot.sh ...
1
vote
1answer
1k views

How to configure Python Script to run as a daemon

I have a couple webservers sitting behind a loadbalancer, and i found "watcher.py" here: https://github.com/splitbrain/Watcher I chose this script for several reasons: recursive through folders, lots ...
1
vote
1answer
714 views

Fisheye + Nginx Reverse Proxy

I'm trying to run Fisheye behind a proxy. So far, I've managed to get Jira and Stash to work behind the proxy, but not Fisheye. Here's my config file in Nginx: server { listen 80; server_name ...
1
vote
2answers
981 views

Nginx fails to parse config because of scgi_params

I'm trying to install libtorrent, rtorrent and rutorrent. I'm at the stage of installing rutorrent, and their wiki says I have to put this location block in my config file: location /RPC2 { ...
1
vote
2answers
887 views

Is there any equivalent to php5-cgi for python?

nginx doesn't allow to directly execute external programs, so to run CGIs you need to run an standalone fcgi backend and connect to it with the fastcgi_pass directive. For php it's easy, e.g. using ...
1
vote
1answer
579 views

Intermittent error 404 during higher loads. (nginx/php/apc/mysql)

I have a 4 cpu core VPS with 4GB ram. It is running Ubuntu 10.04 with nginx/0.7.65, PHP 5.3.2, and MySQL. I use php5-fpm for the communication to nginx. I also have php5-apc complimenting with php ...
1
vote
1answer
876 views

Can I use only 2 servers for nginx load balancing?

If I have only 2 servers, can I make each as a backend and also front end? Server 1: master load balancer / backend server1 Server 2: slave load balancer / backend server2 is it possible?
0
votes
1answer
73 views

nginx open reverse proxy?

Somehow, and I'm not sure how, we have configured an nginx reverse proxy that is acting as an open proxy. The log files tells us the matching requests are going against the following conf file: map ...
0
votes
3answers
873 views

Nginx sslv3 poodle disable

I tried setup SSL cert without SSLv3 in my nginx, but SSL Labs say, my server have SSLv3 how to disable it. My config: add_header Strict-Transport-Security max-age=31536000; add_header ...
0
votes
2answers
758 views

using single nginx server to serve/proxy PHP, Python and NodeJS

I am trying to figure out how best to use Nginx as proxy for serving PHP (via PHP5-FPM), Python (via gunicorn) and NodeJS. My current default file in the sites-available directory is copied below. ...
0
votes
3answers
4k views

Magento Error 404 after moving from Apache to nginX

I moved my magento store from Server "A" which was on Apache to Server "B" running NginX. Copied all files and folders, Exported and Imported the SQL DB, Altered the local.xml file with the new DB ...
0
votes
2answers
380 views

Need custom Nginx regex

Following is what I have right now and it works but needs some improvement. I am guessing that I will need to use regex and that is why I need help. What I need is this ...
0
votes
1answer
381 views

Nginx Execute Multiple Location Blocks

I have the following nginx location block: location ^~ /publish { allow 127.0.0.1; #Allow home allow 99.100.101.102; deny all; } Then this location block to process PHP after: location ...
0
votes
2answers
320 views

nGinx non-www to www redirect

I have been working with apache for years and now wanted to move to nGinx keeping in view the performance everyone on internet seems to be talking about. But I its very frustrating for me for not ...
0
votes
2answers
660 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) ...
0
votes
1answer
273 views

Serving a page whose URL ends in a slash with nginx

I want to make nginx serve an HTML file for /foobar/. I tried 2 configurations and neither worked. In Apache you do it like this: AliasMatch ^/foobar/$ /home/admin/foobar/foobar.html My first ...
0
votes
1answer
175 views

Nginx vhost configuration questions

I have a NginX vhost, where all static content is served by nginx and anything that's not found or ends with php proxies to apache. Just wanted to check if I have locations right: location / { ...
0
votes
1answer
881 views

Apache to Nginx rewrite rules conversion tool

Converting the rewrite rules from Apache to Nginx does not seem to be that difficult However, I'd like to automate the job, as we are planning to migrate a number of sites. Is there any existing ...
-1
votes
2answers
3k views

Unable to allocate memory for pool, How to fix it

I am hosting a number of websites on my Debian server running on NginX, all of my website's log files shows me an error like this 2011/11/23 10:01:03 [error] 5320#0: *349 FastCGI sent in stderr: ...
102
votes
2answers
38k views

How can I see which flags Nginx was compiled with?

How can I check what modules have been added to an nginx installation?
10
votes
1answer
8k views

The strange case of Mr. Time To First Byte

I've got a webserver on a Linode 1024 VPS based on Ubuntu 11.10 Nginx 1.0.5 PHP 5.3.6 (with PHP-FPM, APC) Varnish 3.0.2 And a couple of blogs there based on WordPress 3.3.1. One of them is a ...
8
votes
7answers
6k views

Varnish -> Nginx -> Apache a good idea?

I'm thinking about the architecture for a new Webserver. Would having Varnish as a cache in front of Nginx as a reverse-proxy and serving static files in front of apache for all heavy lifting be a ...
26
votes
1answer
8k views

nginx name-based virtual hosts on IPv6

I have an nginx server serving up nearly half a dozen different websites. It's running on a Linode that just got IPv6 native support (Dallas data center), and I'm trying to configure most of my sites ...
18
votes
4answers
18k views

Which is best for Django? Lighttpd or Nginx? Or maybe something else? [closed]

Which of Lighttpd and Nginx is, basing on your experience, better suited for Django? I've used both and can hardly notice any difference at all, they just work fine... Are there any use cases when one ...
10
votes
3answers
11k views

Enabling nginx Chunked Transfer Encoding

It looks like nginx 0.8.35 may support chunked transfer encoding: Changes with nginx 0.8.35 01 Apr 2010 *) Change: now the charset filter runs before the ...
9
votes
4answers
7k 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?
6
votes
3answers
1k views

Can you rely on Nginx as your only webserver for php/mysql

Can you rely on Nginx to be your only webserver. I know in terms of performance it works well, but how does it do in terms of security. I know Apache is stable and has ModSecurity. This is not the ...
13
votes
2answers
8k views

Do HTTP reverse proxies typically enable HTTP Keep-Alive on the client side of the proxied connection and not on the server side?

HAProxy has the ability to enable HTTP keep-alive on the client side (client <-> HAProxy) but disable it on the server side (HAProxy <-> server). Some of our clients connect to our web service ...
13
votes
2answers
12k views

User per virtual host in Nginx

Is it possible in nginx configure different user per virtual host? Something like server { user myprojectuser myprojectgroup; ... }
11
votes
3answers
14k views

How to use nginx to proxy to a host requiring authentication?

How can I setup an nginx proxy_pass directive that will also include HTTP Basic authentication information sent to the proxy host? This is an example of the URL I need to proxy to: ...
11
votes
2answers
8k views

nginx url rewriting: difference between break and last

I don't understand the difference between break and last (flags of rewrite). The documentation is rather abstruse. I've tried to switch between the two in some of my configs, but I couldn't spot any ...
10
votes
1answer
16k views

Configure Nginx as reverse proxy with upstream SSL

I try to configure an Nginx server as a reverse proxy so the https requests it receives from clients are forwarded to the upstream server via https as well. Here's the configuration that I use: http ...
4
votes
2answers
6k views

How to Create Jailed Users?

My servers run CentOS: Nginx + PHP-FPM (PHP via Fast-CGI). Every site is on its own VirtualHost. Currently both Nginx and PHP-FPM run under root. I know this is bad practice, and there is no reason ...
19
votes
1answer
27k views

How does try_files work?

I looked at the nginx documentation and it still confuses me utterly How does try_files work? Here is what the document says From NginxHttpCoreModule try_files syntax: try_files path1 ...
7
votes
6answers
2k views

why no examples of horizontally scalable software load balancers balancing ssl?

I have a bunch of questions with respect to ssl, local sessions, and load balancing which seem to be interconnected, so I apologize in advance for the length of this question. I have a website which ...
6
votes
2answers
3k views

How To limit Nginx Auth_Basic re-tries?

I have protected a web folder with Nginx's Auth_Basic module. The problem is, we can try several passwords until it works (brute force attacks). Is there a way to limit the number of failed re-tries?
14
votes
3answers
808 views

Does this prove a network bandwidth bottleneck?

I've incorrectly assumed that my internal AB testing means my server can handle 1k concurrency @3k hits per second. My theory at at the moment is that the network is the bottleneck. The server can't ...
13
votes
3answers
19k views

Nginx config reload without downtime

I use nginx as a reverse proxy. Whenever I update the config for it using sudo "cp -r #{nginx_config_path}* /etc/nginx/sites-enabled/" sudo "kill -s HUP `cat /var/run/nginx.pid`" I face a brief ...
12
votes
5answers
17k 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 ...
10
votes
3answers
36k 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; ...
9
votes
5answers
9k views

How to get nginx to redirect from www to non-www domain?

Let's say I want to redirect from www.example.com to example.com and I want to do this using nginx. I looked around and did not see any good documentation on this so I figured I would ask and answer ...
8
votes
2answers
3k views

nginx case insensitive rewrite

I am trying to make my nginx redirects as clean as possible. I understand ~* is for case insensitive but I can only get it to work in example 2. Example 1 rewrite ^/foobar ...
7
votes
2answers
7k views

why do nginx process run with user nobody

I was trying to setup nginx to run with one of my rails apps, when having a look at output for ps -e | grep nginx , I realised nginx worker processes run with user nobody. Is there a reason why they ...
7
votes
1answer
585 views

How do I verify site ownership on Google Webmaster Tools through nginx.conf?

Since a couple of years ago, Google Webmaster Tools site ownership verification process started to require that verification files have certain content, instead of simply being there and returning 200 ...
7
votes
1answer
2k views

Poor load balancer performance on rackspace and centos

I am load testing different options for load balancing, and am getting poor results from Nginx, haproxy, and varnish. I have one 4GB load balancer at Rackspace, hitting 4x1GB app servers. I'm ...
7
votes
2answers
4k views

How to rate-limit in nginx, but including/excluding certain IP addresses?

I'm able to use limit_req to rate-limit all requests to my server. However I'd like to remove the rate restriction for certain IP addresses (i.e. whitelist) and use a different rate restriction for ...
7
votes
5answers
3k views

Nginx + Apache trailing slash redirect [closed]

I have a Nginx server running on 80 port working as a proxy to Apache 2.2 which is listening to 127.0.0.1:8080 When I access http://hostname/subfolder/ it works great. When I access ...
6
votes
1answer
6k 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 ...
3
votes
2answers
1k views

Nginx 1.6.3 to 1.8 upgrade

I'm on Linux Mint LMDE. I just receive a upgrade of nginx from 1.6.3 to 1.8.0 with aptitude and now, I got blank page on all my websites Here my configuration : server { listen 80; ...
3
votes
1answer
3k views

maintaining redirects in nginx from an external source

I am in the situation to give our marketing department the opportunity to maintain their redirects by their own. Until now, they passed the information to the IT department and we maintained it for ...