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

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 ...
0
votes
1answer
239 views

nginx/fastCGI two domains, one codebase and a subdirectory

I have a website running on Nginx, FastCGI and php-fpm, with a number of pages in subdirectories on it (that are run through the same front-controller as the rest of the website). ...
1
vote
2answers
3k views

nginx: Redirect everything except a few directories to new hostname

I'm serving a webservice (API + Webiste) through nginx and its canonical domain name changed recently. The API is split from the user-facing website by subdirectories (eg /api/ and /download/ are part ...
0
votes
2answers
1k views

SSL/TLS Version in Nginx

I installed Nginx and enabled SSL. server { server_name vorb.de; listen 443; root /var/www/vorb.de/pub; ssl on; ssl_certificate cert.pem; ssl_certificate_key ...
0
votes
1answer
194 views

Nginx upstream_fair statistics

I am running nginx 1.0.6 as a load balancer and I am using the upstream_fair module. On its Nginx blog page (http://nginx.localdomain.pl/wiki/UpstreamFair), it mentioned that you can pull statistics ...
2
votes
2answers
371 views

CentOS yum missing depency kernel >= but kernel is already >=

I am trying to install Nginx on a CentoOS server and having a hard time. I am new to CentOS for the most part but I am familiar with Debian (but this server has to be CentOS) After adding the EPEL ...
1
vote
2answers
198 views

add passenger module to nginx without sources

I have a ubuntu 10.04 server and i've installed nginx from repositories with: apt-get install nginx i have all my sites running and i want to install redmine but i'm having problems with passenger. ...
1
vote
1answer
230 views

More terse way to write these nginx location rules?

I have tried to rewrite the following Nginx locations rules to a single location block, but because of the (.*)$ it seems to be evading me.. location ~ /admin { rewrite ^/admin(.*)$ ...
25
votes
3answers
26k views

nginx real_ip_header and X-Forwarded-For seems wrong

The wikipedia description of the HTTP header X-Forwarded-For is: X-Forwarded-For: client1, proxy1, proxy2, ... The nginx documentation for the directive real_ip_header reads, in part: This ...
0
votes
1answer
3k views

Using Nginx how do I redirect single URIs from http to https?

Most transactions from the webapp are secured on their own but do not show the lock icon when transactions are happening in the browser. The goal is to have certain pages, like the login pages, be ...
0
votes
1answer
323 views

nginx /admin /login wordpress

I want to setup simpler urls in nginx to login into wordpress i.e. /admin /login in nginx I have tried multiple ways of tackling this with no luck. any ideas? currently working with this, but I know ...
1
vote
0answers
930 views

Lots of TIME_WAIT connections with nginx reverse-proxy

I'm using nginx as reverse proxy to redirect some traffic to openfire XMPP server. Here's what I see in netstat: 972 connections to port 80 from outside (includes website and redirected XMPP over ...
1
vote
1answer
2k views

IE8 reports a GeoTrust SSL certificate as “not trusted”, other browsers fine

We've been using a GeoTrust SSL certificate, for some time now, and I just got a call that Internet Explorer warns its users that our certificate is not trusted. I really have no clue what's going on. ...
1
vote
1answer
431 views

Disable worker with nginx?

we'd like to migrate to nginx and want to have the same behaviour as we have at the moment: We're using the following load balancing setup: Apache mod_jk with AJP connected to JBoss 4.2.3 workers. ...
1
vote
1answer
3k views

How to actually use the nginx HTTP Auth module?

I've always used Apache 2 for authentication, now I'm using nginx, I have no clue how to include authentication for nginx, do I still use the .htaccess file? I want to use the authentication module ...
0
votes
2answers
179 views

nginx rewrite to alphabetized subdirectory

I'm trying to convert the following Apache mod_rewrite rule into an appropriate nginx format: RewriteCond %{REQUEST_FILENAME} (.*)/([^\/])([^\/]+)/?$ RewriteCond %1/%2/%2%3 -d RewriteRule ^/?.* ...
1
vote
3answers
1k views

How do I keep the download count of a url in Nginx?

More precisely can I configure Nginx to output the log entry to a separate log file whenever a particular url is requested? Later the number of lines in that log can give me the download count. ...
0
votes
1answer
92 views

nginx rewrite login and login/ in one statement

Currently I'm using location /login { rewrite ^/login/$ /login.php last; rewrite ^/login$ /login.php last; } to rewrite www.example.com/login and ...
2
votes
1answer
625 views

Nginx rewrite question

My goal is that requests for /foobar?key=123 should redirect to /download/foobar.html?key=123. I currently use the following code to accomplish this: location /foobar { rewrite ^/foobar(.*)$ ...
1
vote
0answers
821 views

nginx does not close loopback connections

I'm using nginx in reverse-proxy mode. Here's relevant part of config file: server { listen 80; server_name ~^web.redhelper\.ru$ ; access_log off; location /http-bind { ...
2
votes
2answers
2k views

Custom autoindex pages with nginx

Is there a way to define your own autoindex pages in nginx? I want to add my own HTML and CSS to the generated autoindex pages.
2
votes
2answers
1k views

store high amount of photos (150 million) and make available for web [closed]

For a actual project I must setup a high-available storage server who can store and publish (http) 150 million photos in 7 sizes means total 1050 million files. For every photo we need total 200 KB ...
1
vote
1answer
182 views

Why is nginx returning a 200 page without having that domain configured?

I'm using nginx and I follow a simple tutorial to create vhosts. My problem is that if someone point his DNS to my server, nginx seems to not care about the server_name directive. I have: listen ...
1
vote
1answer
5k views

Hosting Folder in the home directory using nginx

I would like to add a condition in an adduser script to update nginx.conf for it to load ~/www as http://ipaddress/~user whenever I create a new user. And when a user is named www.domainname it will ...
21
votes
3answers
25k views

How to enable correct charset HTTP-header in NGINX

What is the right way to enable correct charset headers in NGINX? I'm analyzing my website with Google Page Speed. It says that I should specify the charset of HTML files in HTTP-headers. What is the ...
1
vote
1answer
2k views

404 .php page response nginx + php fpm

I just made a fresh install of a server with nginx with php5-fpm. Why if you visit a php page that doesn't exist you get a blank page instead of the default "not found" page of nginx? Shouldn't this ...
10
votes
1answer
25k views

how do I get nginx to forward HTTP POST requests via rewrite?

My iOS app is currently accessing domain A via http POST but I would like to forward all requests to domain B. If I use the usual "rewrite ^/(.*)$ http://mydomain/$1 permanent;" the POST data ...
3
votes
1answer
2k views

Nginx with Passenger behind HAProxy causes 503 errors

Over the last month I was forced to learn a lot of things about server configuration, integration, AWS, etc. I have never done these to this extent. I got everything up and running well for my app ...
7
votes
3answers
12k views

nginx rewrite append a parameter at the end of an url

I need to configure my reverse proxy so that the following parameter will be added at the end of the url: &locale=de-de This almost works: rewrite ^(.*)$ $1&locale=de-de break; However, the ...
3
votes
4answers
11k views

Nginx as network edge HTTP cache?

Looking to implement an office network with peak # users of 40-50 people and clients and I'm thinking that nginx could be used as a transparent proxy to cache requests to any HTTP-based site at the ...
1
vote
3answers
2k views

How to act differently according to the IP address with Nginx?

I currently have an application I want accessible for everyone coming from 2 specifics IP address and protecting the same application via the same URL from user coming from another IP. For example, I ...
0
votes
1answer
451 views

How to configure nginx on Ubuntu

I have installed Nginx server on Ubuntu 11.04 system. The default directory is /usr/share/nginx/www, but I want that Nginx server will access the folders of http://localhost just like Apache web ...
7
votes
2answers
5k views

Maintenance page on nginx, best practices

I want to configure the server to show a maintenance page when it exist. I tried this code and works: location / { try_files /maintenance.html $uri $uri/ @codeigniter; } But I noticed it would ...
1
vote
2answers
3k 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 ...
1
vote
1answer
751 views

X-Forwarded-For (XFF) http header field confusion for Nginx?

We have webserver setup as follows Loadbalancer (HAPROXY) <---> Nginx <---> App servers To make Nginx aware of real clients that are making connections , I compiled Nginx with HttpRealIpModule ...
2
votes
2answers
571 views

ngingx allow single IP AND internal requests

I'm trying to setup an nginx server to allow requests from a single IP and as well internal requests. The reason being that this box could be hit directly, or via a proxy_pass. I haven't been able to ...
1
vote
1answer
542 views

Stop nginx from trimming file name in directory list?

Just a quick question: How can I prevent nginx from trimming file name with ... in listing directory?
0
votes
1answer
310 views

Nginx rewrite question

Trying to convert over an apache config to nginx. <Directory /usr/local/image/> Order allow,deny Allow from all </Directory> Alias /key1 /usr/local/image Alias /key2 /usr/local/image ...
1
vote
2answers
2k views

Ruby via FastCGI and NGiNX?

I have NGiNX setup, and would like to be able to run sites I create in Ruby. However my server is pretty fail, only like 250mb memory, probably less, so instead of having to run each Ruby site with ...
4
votes
2answers
2k views

How to serve MailCatcher behind HTTPS and authentication?

I am developing a Ruby on Rails app, and have a staging server. But this staging server isn't sending any emails -- instead, it is discarding them. In order to test our emails being sent, and how ...
0
votes
1answer
2k views

Nginx running on Debian lenny, how to add SSL?

Some time ago I installed Nginx and Passenger on Debian lenny with... sudo apt-get install nginx sudo gem install passenger sudo passenger-install-nginx-module This is what I get when I do nginx -V ...
1
vote
3answers
1k views

Using Nginx and apache on the same system

I am using apache server on ubuntu 11.04. I came to know about Nginx server which has some good features. So I decided to have a ride on it. But I am little bit confused as I have already installed ...
1
vote
2answers
106 views

How to find out which PHP application/page is being run at this moment?

I have three web server using nginx as frontend and php-cgi as backend. We use DNS round robin to distribute load. In this server we have several PHP applications, each application is stored in its ...
0
votes
1answer
690 views

nginx, php-fcgi, VBulletin, Wordpress & Node.js

CompassionPit.com is a Node.js app. The CompassionPit blog is WordPress and the CompassionPit forum is VBulletin. Everything was working fine and dandy until I installed the VBseo plugin for ...
0
votes
2answers
2k views

Nginx Permission 13

I am on a shared host with rights to inherit the nginx root installation and overriding it's config file (note: I do NOT want to compile my own nginx in my home directory). I wrote a ...
1
vote
2answers
244 views

NginX redirects

Being a bit of a newbie to NginX redirects and not particularly ninja with my regex, could someone please provide some points for how to do the following 301 redirects in a sane way. (apologies for ...
0
votes
1answer
94 views

Specialized cache for Nginx, one chache for all requests

I am using Nginx as my main webserver. I need to cache some special data, and I need the data from all requests to be stored in one cache and be retrieved from that cache. In each request, I will ...