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
44
votes
2 answers

Merging variable with string in config file

I the have following setup in my conf file upload_set_form_field $upload_field_name.name "$upload_file_name"; But I want change chosen param name to: upload_set_form_field ($upload_field_name+"[name]") "$upload_file_name"; So I can get…
Swistak
  • 541
  • 1
  • 4
  • 4
43
votes
6 answers

Increase PHP-FPM's max upload/post size

I'm running php5-fpm under Nginx on Ubuntu 14.04. I want to increase the max upload size. I have edited my /etc/php5/fpm/php.ini to have the following lines defined as below: upload_max_filesize = 20M post_max_size = 25M and I restarted php5-fpm…
harryg
  • 901
  • 2
  • 10
  • 19
43
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.
  • 555
  • 1
  • 4
  • 10
43
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,393
  • 9
  • 33
  • 52
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
42
votes
1 answer

For Server-Sent Events (SSE) what Nginx proxy configuration is appropriate?

I've read a bunch of different questions on what Nginx configuration is appropriate for SSE and came up with some confusing results regarding what settings to…
c4urself
  • 5,530
  • 3
  • 28
  • 39
42
votes
2 answers

How to rate-limit in nginx, but including/excluding certain IP addresses?

I'm able to use limit_req to rate-limit all requests to my server. However I'd like to remove the rate restriction for certain IP addresses (i.e. whitelist) and use a different rate restriction for certain others (i.e. certain IPs I'd like as low as…
Jason Cohen
  • 1,127
  • 3
  • 14
  • 21
41
votes
3 answers

Setting ssl_prefer_server_ciphers directive in nginx config

This question is about setting the correct value of ssl_prefer_server_ciphers while configuring nginx. According to a fairly typical config suggested by Mozilla, the value should be off (source:…
Hassan Baig
  • 2,325
  • 12
  • 29
  • 48
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,681
  • 14
  • 56
  • 82
41
votes
3 answers

nginx as reverse proxy with upstream SSL

I'm building a proxy for an internal API to allow clients to connect without having to have the self-signed certificates installed. Clients (built, owned and used only internally) will connect over SSL to the nginx box, where I'm using XSendfile to…
simonmaddox
  • 560
  • 1
  • 4
  • 7
41
votes
2 answers

How to reduce number of sockets in TIME_WAIT?

Ubuntu Server 10.04.1 x86 I've got a machine with a FCGI HTTP service behind nginx, that serves a lot of small HTTP requests to a lot of different clients. (About 230 requests per second in the peak hours, average response size with headers is 650…
Alexander Gladysh
  • 2,423
  • 8
  • 31
  • 49
40
votes
5 answers

SSL & Ngnix: no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking

I have managed to create my certificates with LE with not errors, I have also managed to redirect my traffic from port 80 to port 443. But when i reload my nginx server I am unable to access my website. The Ngnix error logs show this line: 4 no…
0xtuytuy
  • 523
  • 1
  • 4
  • 6
40
votes
3 answers

nginx use $server_name on ssl_certificate path

How I can use a variable name in file path ? ssl_certificate /home/ec2-user/.certificados/$server_name.crt; ssl_certificate_key /home/ec2-user/.certificados/$server_name.key;
Claytinho
  • 513
  • 1
  • 4
  • 6
40
votes
4 answers

Forward Custom Header from Nginx Reverse Proxy

I have an nginx web server acting as a reverse proxy to forward requests on to Apache for additional handling (I'm begging you not to ask why). I have a request to which I'm trying to attach a custom header and I'd like for nginx to forward that…
Rob Wilkerson
  • 1,465
  • 4
  • 17
  • 25
40
votes
4 answers

Enable basic auth sitewide and disabling it for subpages?

I have a relatively straight forward config: upstream appserver-1 { server unix:/var/www/example.com/app/tmp/gunicorn.sock fail_timeout=0; } server { listen 80; server_name example.com; location / { proxy_pass…
Benjamin Wohlwend
  • 729
  • 2
  • 7
  • 14