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

4
votes
1answer
5k views

NGINX return correct headers with custom error documents

I've set up NGINX to return custom error documents for my proxied server, it shows the correct file but always returns a 200 OK header. The relevant NGINX config is server { listen ...
3
votes
1answer
2k views

Different PHP-configs in Nginx

I have a web-server running multiple server (virtual hosts) using nginx and fastcgi passing to a unix-socket. What I want to accomplish is a set-up with beta.example.com and live.example.com, where ...
3
votes
2answers
11k views

What is nginx equalant for my htaccess mod_rewrite?

Previously i was using linode VPS running Apache for my CodeIgniter website. Today i installed nginx and my website landing page is coming but the other pages that is using htaccess for rewriting URL ...
2
votes
3answers
2k 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 ...
2
votes
2answers
1k views

How do I reserve bandwidth for rsync?

Currently nginx uses all my bandwidth. How do I leave some for rsync?
1
vote
2answers
1k 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. ...
1
vote
0answers
132 views

Handling multiple server blocks in nginx configuration

I am working on setting up a proxy server for my application.The use case is I want a specific set of requests to be redirect to say abc.com and rest of the request to be redirected to xyz.com. Eg:If ...
1
vote
1answer
3k views

Nginx rewrite rule (subdirectory to subdomain)

I would like to redirect admin subdirectory to a subdomain. I tried to create this rule for Nginx however it's not working: location ^~ /admin/ { rewrite ^/admin(.*) ...
1
vote
2answers
1k views

running nginx as a reverse proxy with apache

Q1) Do I need mod_deflate running on apache? does it help in performance in anyway? Q2) Do I need mod_cache running on apache if nginx is serving a static caching proxy? <IfModule mod_cache.c> ...
0
votes
1answer
2k views

Symfony2 app in subdirectory of nginx configuration

I'm trying to set up my environment such that surveyadmin.local points at one directory and surveyadmin.local/api points at another. However, no matter what I change, the /api URL always results in a ...
0
votes
2answers
279 views

Accidently set chown “root” to all my server

I'm running 2 magento apps on my web server and I accidently set "chown -R www-data:www-data *" from the root of the server. Meaning, all the files were owned by the user root. This immediately ...
11
votes
2answers
5k views

Best way to prevent default server?

I have a number of vhosts, and I'd like to "turn off" the default vhost, either by blank page, error page, or generally whatever is the most efficient use of Nginx's resources, whilst only allowing ...
6
votes
3answers
3k views

Nginx includes config files not in order?

Is the order in which Nginx includes configuration files fixed, or random? Apache explicitly states wildcard characters are expanded in alphabetical order. With Nginx it seems this does not apply, and ...
6
votes
1answer
5k views

Variables in log name - nginx

I have the following default server setup in nginx: # Default HTTP Server server { listen 80 default; server_name _; access_log /var/log/nginx/$server_name.access.log; error_log ...
5
votes
3answers
6k views

Linux web servers that support websockets?

I'm currently having a lots of difficulties trying to play with socket.io which needs websockets support from the server (reverse-proxying). I was wondering, is there any other web servers out there ...
3
votes
0answers
6k views

nginx as smtp proxy [closed]

I was ordered to configure nginx as SMTP proxy. That's all details I have. I've looked though some books and docs and don't see neither any examples of such configuration nor explanations of why this ...
2
votes
1answer
669 views

How to load static files in an Nginx + Flask setup if the app is mapped to a sub-directory

I have a basic html site running at a domain (say example.com) and I want to run a flask app in a sub-directory (eg:example.com/test) flask app is running on port 5433 using the default flask ...
2
votes
1answer
336 views

nginx always gives 500 error for JS file after I change it

I'm running nginx on a local CentOS 6.3 server. I have a particular javascript file that loads in a webpage. If I change the javascript file, and refresh the webpage, I always get a 500 error. Then ...
2
votes
2answers
6k 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 ...
2
votes
1answer
2k views

Nginx: expires header not working

I'm having issues with the expires header field. The following nginx rules give me this header (no expire header). Ideas why the expires headers arn't being passed? Header for: /css/v1/afile.css ...
2
votes
1answer
2k 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 ...
2
votes
2answers
2k views

Getting rid of “Welcome to nginx!”

I've just setup nginx on my Ubuntu staging machince. Entering http://192.168.1.1./index.php works like a charm and loads the index.php file i've put in the /var/www/public_html folder. ...
1
vote
1answer
61 views

nginx: Redirect https traffic without subdomain to subdomain (non-www to www)

My current ssl certificate covers the subdomains www.example.com and static.example.com So if a users try to access my site via https://example.com I want to redirect him to https://www.example.com . ...
1
vote
2answers
776 views

Why is my Nginx location rule not taking precedence?

I have a PHP application (Wordpress) in the root folder of my site, and all requests to the site run through it happily. However, I have a subfolder, _links, which I would like to use to execute ...
1
vote
1answer
710 views

Nginx: How to limit request rate based on user agent

Trying to get the following behavior working in nginx A default rate limit of 1r/s for each ip when using a browser. A rate limit of 10r/s for bing and google spiders. Reject bad bots. Unfortunately ...
1
vote
2answers
172 views

How to make NGINX redirect from http to https?

I want to redirect from http to https in an NGINX server block. Following an answer in a related post I tried adding another server block in the following NGINX config file, but got a 'conflicting ...
1
vote
1answer
903 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
1k 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
1answer
461 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 ...
1
vote
2answers
1k 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
718 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
874 views

How can I make Nginx return HTTP 503 when my proxied app server is down?

I have an nginx web server sitting in front of a Jetty Java app server running a web application. I'd like to configure nginx to return a HTTP 503 if the proxied Jetty server is down. This way when ...
1
vote
1answer
998 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
0answers
82 views

nginx: gzip on server is lost during proxy

Using nginx as a reverse proxy/load balancer in front of iis/.NET application servers. Our servers are configured to gzip response payloads. Works fine. When we stick gzip in front, responses are no ...
0
votes
1answer
197 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
6k 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
2k views

Nginx reverse proxy - passthrough basic authenication

I am trying to setup nginx as a reverse rpoxy server in front off several IIS web servers who are authenticating using Basic authentication. (note - this is not the same as nginx providing the auth ...
0
votes
2answers
417 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
2answers
357 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
721 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
287 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
181 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
887 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
4k 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: ...
20
votes
3answers
26k views

Installing optional Nginx modules with apt-get

I currently have Nginx installed via the instructions on the Nginx site: nginx=stable sudo su - add-apt-repository ppa:nginx/$nginx apt-get update apt-get install I have configured Nginx and it ...
124
votes
2answers
51k views

How can I see which flags Nginx was compiled with?

How can I check what modules have been added to an nginx installation?
21
votes
2answers
16k views

nginx + php-fpm - where are my $_GET params?

I have a strange problem here. I just moved from apache + mod_php to nginx + php-fpm. Everything went fine except this one problem. I have a site, let's say example.com. When I access it like ...
30
votes
1answer
11k 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 ...
10
votes
1answer
11k 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 ...