Questions tagged [nginx]

Nginx is a web and proxy server. Note that questions on the use and configuration of server software may be off-topic and subject to closure if they do not directly involve a programming context. Other Stack Exchange sites such as Super User, Server Fault, or Webmasters may be more appropriate places to ask such questions.

Nginx ("engine x") is a lightweight and high-performance HTTP , and , released under a BSD-like license.

From the nginx wiki:

Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx in 2002, with the first public release in 2004. Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

Resources:

Useful Links

Talks

Tengine

54687 questions
12
votes
7 answers

403 forbidden - Nginx - using correct credentials

I am trying to password protect a directory on my Nginx powered site that contains things like phpMyAdmin, MemcacheMyAdmin, and more admin utilities. This directory is placed in the root of my site at: domain.com/control/ The absolute path on my…
Playforward
  • 560
  • 2
  • 6
  • 21
12
votes
1 answer

nginx location regex - character class and range of matches

I am trying to setup a regex for the path /s/<4-6 character string here> where I capture the 4-6 character string as $1. I tried using the following two entries, but both fail location ~ ^/s/([0-9a-zA-Z]){4,6}+$ { ... location ~…
Dave
  • 2,409
  • 3
  • 22
  • 28
12
votes
1 answer

Gunicorn worker timeout

I have a Django application running in Gunicorn behind Nginx. Everything works fine, exect for one strange thing: I have a "download" view and a RESTful json API. When call the download view I use urllib2 to access the json API to get information.…
Anton
  • 936
  • 1
  • 8
  • 27
12
votes
1 answer

Does uWSGI need to be restarted when Django code changes?

I'm working on a Django webapp that's running under nginx and uWSGI. When I deploy new Django code (e.g., settings.py), do I need to restart uWSGI? If so, why? Background: I had a scenario where I updated settings.py and some other code and…
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
12
votes
2 answers

PHP processing speed apache 2.4 mpm-prefork mod_php 5.4 vs nginx 1.2.x PHP-FPM 5.4

I've been looking for days to see if someone has done a good, documented, PHP processing speed comparison between apache-mpm-prefork 2.4 with mod_php 5.4 and nginx 1.2.x + PHP-FPM 5.4 Why I'm looking: The only test I saw are abount benchmarks,…
petermolnar
  • 1,626
  • 14
  • 23
12
votes
2 answers

How to re-use NGINX proxy settings in several locations

I have the need to restrict access to certain files based on a query string parameter. I have an NGINX proxy server that sits in front of several other nginx web servers for load balancing. I have decided to enforce this query string parameter at…
bmckim
  • 143
  • 5
12
votes
3 answers

Using nginx to simulate slow response time for testing purposes

I'm developing a facebook canvas application and I want to load-test it. I'm aware of the facebook restriction on automated testing, so I simulated the graph api calls by creating a fake web application served under nginx and altering my /etc/hosts…
12
votes
4 answers

nginx proxy: connect() to ip:80 failed (99: Cannot assign requested address)

An nginx/1.0.12 running as a proxy on Debian 6.0.1 starts throwing the following error after running for a short time: connect() to upstreamip:80 failed (99: Cannot assign requested address) while connecting to upstream, client: xxx.xxx.xxx.xxx,…
mariow
  • 608
  • 1
  • 4
  • 12
12
votes
5 answers

Compressing rails assets and nginx gzip

Do I have to configure nginx to compress assets (gzip set to on) if I have compressed rails assets with rake assets:precompile? I mean does it make sense or not? Will performance better or worse? Thank you!
ka8725
  • 2,788
  • 1
  • 24
  • 39
12
votes
3 answers

fallback for an nginx upstream proxy

I have an nginx instance in front of a cluster of image servers: upstream img-farm-1 { server 10.0.1.1; server 10.0.1.2; server 10.0.1.3; server 10.0.1.4; # etc } location ~ ^/static: { rewrite /static:(.*) /$1…
dland
  • 4,319
  • 6
  • 36
  • 60
12
votes
3 answers

How to deploy Ruby Rack app with NGINX

I want to deploy a simple Ruby Rack service with NGINX. I read various things on the internet, none of which were helpful enough. Lets say I have this (in reality it's a bit more complex but still < 200 lines of code service): require 'rack' class…
ddinchev
  • 33,683
  • 28
  • 88
  • 133
12
votes
4 answers

cURL Multi Threading with PHP

I'm using cURL to get some rank data for over 20,000 domain names that I've got stored in a database. The code I'm using is http://semlabs.co.uk/journal/object-oriented-curl-class-with-multi-threading. The array $competeRequests is 20,000 request…
user1647347
  • 507
  • 1
  • 8
  • 23
12
votes
0 answers

Capistrano, Passenger and Nginx - How do they work together?

I'm currently using Capistrano, Passenger and Nginx with my Rails application, but still, I'm confused on how it all works together. Here's what I know so far: Nginx is a web server that responds to requests, like Apache but more…
gerky
  • 6,267
  • 11
  • 55
  • 82
12
votes
1 answer

How do I configure nginx to load try_files from a different folder?

I need some help configuring nginx to load files from a different folder. Here is my config: index index.php; server { server_name domain.com; root /www/domain.com/www/; location / { try_files $uri $uri/…
tvpmb
  • 1,407
  • 2
  • 13
  • 18
12
votes
2 answers

Is there a way to get the current time in nginx?

I am trying to inject the time of an nginx server into an HTTP header. I am able to add to an HTTP header, like so: proxy_set_header HELLO-WORLD 'something'; But now, I want to be able to inject the time into an HTTP header, something that looks…
Sal Rahman
  • 4,607
  • 2
  • 30
  • 43