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.

16419 questions
46
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
  • 563
  • 1
  • 5
  • 7
46
votes
15 answers

NGinx Best Practices

What best practices do you use while using NGinx?
The Pixel Developer
  • 847
  • 3
  • 9
  • 20
45
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
  • 12,504
  • 19
  • 54
  • 73
45
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
  • 687
  • 1
  • 7
  • 12
45
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
  • 561
  • 1
  • 4
  • 4
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,621
  • 4
  • 24
  • 30
44
votes
1 answer

How to resolve the gunicorn critical worker timeout error?

I have used nginx and gunicorn to host my website in two servers, Both server have same versions of packages and website is successfully hosted, But in one of my server gunicorn always gets timeout and I get error [CRITICAL]Worker Timeout Booting…
s.m
  • 543
  • 1
  • 4
  • 8
43
votes
5 answers

User per virtual host in Nginx

Is it possible in nginx configure different user per virtual host? Something like server { user myprojectuser myprojectgroup; ... }
Alex Netkachov
  • 585
  • 1
  • 6
  • 9
43
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
  • 593
  • 1
  • 5
  • 8
42
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
  • 649
  • 1
  • 6
  • 9
42
votes
2 answers

nginx split large configuration file

My nginx default configuration file is becoming huge. I'd like to split it to smaller config files, each including only one, maximum 4 locations to each file, so that I can enable/disable them quickly. Actual file looks like this: server { …
oliverjkb
  • 554
  • 1
  • 4
  • 10
42
votes
2 answers

Nginx: location regex for multiple paths

I have two locations in nginx config that work: location ^~ /media/ { proxy_pass http://backend.example.com; } location ^~ /static/ { proxy_pass http://backend.example.com; } How can I combine these two into one location? What I have done…
Vlad T.
  • 545
  • 1
  • 4
  • 10
41
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,365
  • 4
  • 16
  • 24
41
votes
2 answers

Error code: ssl_error_rx_record_too_long

I have nginx with the following setup: server { listen 80; server_name site.com www.site.com; root /home/site/public_html; listen 443; #server_name site.com www.site.com; #root…
Tiffany Walker
  • 6,541
  • 13
  • 53
  • 77
41
votes
4 answers

How can I debug nginx further than the error log?

I'm currently receiving a fairly large HTTP flood right now, and it's causing my nginx reverse proxy to produce a 502 Bad Gateway. I have a frontend server running nginx as a proxy to my backend server, but it's just getting a bunch of connect()…
Rob
  • 2,303
  • 9
  • 31
  • 50