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
205
votes
8 answers

How can I tell if my server is serving GZipped content?

I have a webapp on a NGinx server. I set gzip on in the conf file and now I'm trying to see if it works. YSlow says it's not, but 5 out of 6 websites that do the test say it is. How can I get a definite answer on this and why is there a difference…
Johnny
  • 7,073
  • 9
  • 46
  • 72
204
votes
10 answers

Setup nginx not to crash if host in upstream is not found

We have several rails apps under common domain in Docker, and we use nginx to direct requests to specific apps. our_dev_server.com/foo # proxies to foo app our_dev_server.com/bar # proxies to bar Config looks like this: upstream foo { server…
Morozov
  • 2,719
  • 2
  • 21
  • 23
203
votes
11 answers

How to run Nginx within a Docker container without halting?

I have Nginx installed on a Docker container, and am trying to run it like this: docker run -i -t -p 80:80 mydockerimage /usr/sbin/nginx The problem is that the way Nginx works, is that the initial process immediately spawns a master Nginx process…
Seldo
  • 5,600
  • 4
  • 20
  • 11
201
votes
8 answers

NGINX to reverse proxy websockets AND enable SSL (wss://)?

I'm so lost and new to building NGINX on my own but I want to be able to enable secure websockets without having an additional layer. I don't want to enable SSL on the websocket server itself but instead I want to use NGINX to add an SSL layer to…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
200
votes
28 answers

Increasing client_max_body_size in Nginx conf on AWS Elastic Beanstalk

I'm running into "413 Request Entity Too Large" errors when posting files larger than 10MB to our API running on AWS Elastic Beanstalk. I've done quite a bit of research and believe that I need to up the client_max_body_size for Nginx, however I…
196
votes
9 answers

Locate the nginx.conf file my nginx is actually using

Working on a client's server where there are two different versions of nginx installed. I think one of them was installed with the brew package manager (its an osx box) and the other seems to have been compiled and installed with the nginx packaged…
rgb
  • 3,144
  • 3
  • 17
  • 26
188
votes
6 answers

nginx: send all requests to a single html page

Using nginx, I want to preserve the url, but actually load the same page no matter what. I will use the url with History.getState() to route the requests in my javascript app. It seems like it should be a simple thing to do? location / { …
prismofeverything
  • 8,799
  • 8
  • 38
  • 53
188
votes
17 answers

Nginx: stat() failed (13: permission denied)

I am using the default config while adding the specific directory with nginx installed on my ubuntu 12.04 machine. server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ##…
user299709
  • 4,922
  • 10
  • 56
  • 88
188
votes
6 answers

nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size

I'm in the process of setting up a new server. The web server of my choice is NGINX. I want to add the domain (e.g. example.com) as a virtual host. I already have two other domains in there and it works fine, but when I try to add the above…
oengelha
  • 2,057
  • 2
  • 12
  • 8
185
votes
4 answers

How to edit nginx.conf to increase file size upload

I want to increase the maximum file size that can be uploaded. After doing some research online, I found that you have to edit the file 'nginx.conf'. The only way I can currently access this file is by going through Putty and typing in the…
Jeff P.
  • 2,754
  • 5
  • 19
  • 41
183
votes
18 answers

nginx showing blank PHP pages

I have setup an nginx server with php5-fpm. When I try to load the site I get a blank page with no errors. Html pages are served fine but not php. I tried turning on display_errors in php.ini but no luck. php5-fpm.log is not producing any…
Mike Glaz
  • 5,352
  • 8
  • 46
  • 73
179
votes
7 answers

How can query string parameters be forwarded through a proxy_pass with nginx?

upstream apache { server 127.0.0.1:8080; } server{ location ~* ^/service/(.*)$ { proxy_pass http://apache/$1; proxy_redirect off; } } The above snippet will redirect requests where the url includes the string "service" to…
Alex Luya
  • 9,412
  • 15
  • 59
  • 91
178
votes
32 answers

nginx.service failed because the control process exited

nginx.service failed because the control process exited $ systemctl status nginx.service nginx.service - Startup script for nginx service Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed…
daliborsb
  • 1,781
  • 2
  • 10
  • 4
174
votes
19 answers

SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

I'm not able to setup SSL. I've Googled and I found a few solutions but none of them worked for me. I need some help please... Here's the error I get when I attempt to restart nginx: root@s17925268:~# service nginx restart Restarting nginx: nginx:…
Galou
  • 1,739
  • 2
  • 12
  • 7
174
votes
3 answers

nginx error "conflicting server name" ignored

server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 #root /usr/share/nginx/www; root /home/ubuntu/node-login; # Make site accessible from …
user1447121
  • 2,861
  • 4
  • 22
  • 23