Questions tagged [nginx]

Nginx ("eNgine x") is a lightweight, high-performance HTTP server, reverse proxy, TCP stream proxy and mail proxy, released under a BSD-like license.

Nginx is a web server and mail proxy known for its high performance and small resource footprint. It is used in many places as a replacement to Apache and also as a front end server to static content or reverse proxying. Nginx is developed under a BSD-like license by Kazakhstani developer Igor Sysoev.

Nginx comes with diverse modules that enable it to perform various different tasks such as load balancing, URL rewriting, request rate limiting, content compression, raw TCP proxying and integration with tools like memcached or scripting languages like Lua.

Nginx is being used by some of the worlds busiest sites like WordPress, Sourceforge, Github and Reddit. Its market share has been raising from 7% in 2008 to over 30% as of June 2016 according to W3techs statistics.

After nine years of development, Nginx 1.0 stable was released on April 2011.

17017 questions
48
votes
6 answers

Permission denied while reading upstream

We have deployed our rails application on on Nginx and passenger. Intermittently, pages of application get loaded partially. There is no error in application log, but the Nginx error log shows the following: 2011/02/14 05:49:34 [crit] 25389#0: *645…
user68613
  • 603
  • 1
  • 5
  • 6
48
votes
4 answers

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 has been running great for a little while. Now, I…
Michelle Tilley
  • 583
  • 1
  • 5
  • 7
48
votes
3 answers

Why is setting Nginx as a reverse proxy a good idea?

I have a Django site running on Gunicorn with a reverse proxy through Nginx. Isn't Nginx just an extra unnecessary overhead? How does adding that on top of Gunicorn help?
TheOne
  • 605
  • 1
  • 6
  • 7
47
votes
3 answers

Use HTTP/2.0 between nginx reverse-proxy and backend webserver

I use nginx as a reverse-ssl-proxy in front of a backend webserver that is capable of doing HTTP/2.0. I noticed that nginx proxies the requests to the backend server via HTTP/1.1 rather than HTTP/2.0. Is it possible to tell nginx to use an…
S1lentSt0rm
  • 1,039
  • 1
  • 9
  • 11
47
votes
2 answers

What does the at-sign "@" mean in nginx location blocks?

I've encountered a few questions and answers on here that use this syntax: location @default { # ... } location /somewhere { try_files $uri @default; } I've searched high and low on the Googles and I can't seem to find any documentation of…
ccnokes
  • 709
  • 1
  • 6
  • 9
47
votes
5 answers

Is there a cloud-based reverse proxy solution in AWS?

The system I have an API deployed on EC2 machines on AWS. Incoming HTTPS requests are passed to an elastic load balancer. The load balancer handles the SSL, and passes the request to an Nginx server, that proxies the requests to the specific…
Adam Matan
  • 13,194
  • 19
  • 55
  • 75
47
votes
9 answers

Nginx fails to stop and nginx.pid is missing

I want to stop Nginx but it fails like this. $ sudo service nginx stop Stopping nginx: [FAILED] And nginx.conf that defines place of nginx.pid have a line. # /etc/nginx/nginx.conf pid …
ironsand
  • 707
  • 1
  • 7
  • 12
46
votes
4 answers

Setting Nginx to catch all unhandled vhosts

If I already have a bunch of virtualhosts, how can I create a virtual host to handle requests that don't match any of the virtualhosts? (i.e. access by IP, another domain linking to IP, .etc .etc)
SandyD
  • 571
  • 1
  • 4
  • 4
46
votes
2 answers

Nginx "Default" Server?

I have an Nginx with a number of enabled server blocks. Each server answers to 1 canonical domain and may forward 1 or more to that canonical URL. I have at least one server (haven't checked all of them yet) where, if I type in a non-existent domain…
Rob Wilkerson
  • 1,465
  • 4
  • 17
  • 25
46
votes
15 answers

NGinx Best Practices

What best practices do you use while using NGinx?
The Pixel Developer
  • 857
  • 3
  • 10
  • 20
45
votes
3 answers

Can nginx location blocks match a URL query string?

Can nginx location blocks match a URL query string? For example, what location block might match HTTP GET request GET /git/sample-repository/info/refs?service=git-receive-pack HTTP/1.1
Derek Mahar
  • 901
  • 3
  • 8
  • 16
45
votes
2 answers

How to quick and easy remove part of an URL in Nginx with HttpRewriteModule?

I know about the HttpRewriteModule, but I don't really know how to handle regex and I would need to redirect all URLs within a certain directory to another, specifically: From: example.com/component/tag/whatever To: example.com/tag/whatever Could…
javipas
  • 1,332
  • 3
  • 23
  • 38
45
votes
1 answer

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 for dual-stack operation. I got the first one up…
Kromey
  • 3,641
  • 4
  • 25
  • 30
45
votes
5 answers

Nginx vs Apache as reverse proxy, which one to choose

this kind of question maybe has been asked here but I couldn't find any that really match my question. Heard that nginx performance is quite impressive, but Apache has more docs, community(read:expert) to get help Now what I want to know, how both…
mhd
  • 633
  • 1
  • 6
  • 9
44
votes
1 answer

Understanding the nginx proxy_cache_path directive

Suppose I have this nginx config file proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=myCache:8m max_size=100m inactive=1h; What does the keys_zone=myCache:8m mean? There's not much said to it in the docs: In addition, all active keys and…
Jürgen Paul
  • 1,265
  • 4
  • 15
  • 22