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

learn more… | top users | synonyms

7
votes
0answers
2k views

Using SAML authentication within nginx

I want to restrict access to some static content, served using nginx, using an existing SAML 2.0 IdP. (In Apache, this would be done with a module such as mod_mellon or mod_auth_saml) What is the ...
6
votes
0answers
517 views

nginx - connect() failed upstream under load testing

I've been doing some load testing with wrk of my nginx reverse proxy -> my web app setup and I noticed that when I get to 1000+ concurrent connections, nginx starts returning 502s and the following ...
5
votes
0answers
3k views

nginx recv() failed (104: Connection reset by peer) while reading response header from upstream

I have recently upgrade my magento from 1.5 to 1.9 and when ever I add a certain product to basket, I started to receive this error: 502 Bad Gateway There were no log entries in the var/log/ folder: ...
4
votes
0answers
39 views

How to maximize utilization of fluentd server?

I have a fluentd server that is processing an average of 1000 req/s. This server is composed by 32 cpus. In this server are running 32 fluentd docker containers with the same configuration. The entry ...
4
votes
0answers
67 views

Improve SSL Performance with Nginx

We have Nginx in the front of our system and we Proxy to Apache at the back. We use SSL/TLS for our connection. Question: Is Nginx the best option to terminate SSL/TLS connections in terms of ...
4
votes
0answers
385 views

start nginx despite missing upstream

I like to run nginx as a local proxy server, serving stale cache files if the upstream server is unavailable. This works well, except the local machine is restarted, while the internet connection ...
4
votes
0answers
254 views

Rails 4 Unicorn+Nginx on Ubuntu 13.04 VPS keeps crashing

I bought a years subscription at bluevm.com (found some coupon code, it was only about $15 for a whole year) to launch my first Rails Production server. I'm running Nginx with Unicorn and MySQL on ...
4
votes
0answers
1k views

Nginx cache shared between multiple servers

We have 8 REST-ish API servers with Nginx using FastCGI with PHP-FPM to handle requests. We're currently using Nginx' FastCGI caching (directives like fastcgi_cache_path). This means that API ...
4
votes
0answers
939 views

Nginx returning 408 error with XHR2 file uploads during mid-upload

A customer of mine is trying to upload a file to our remote nginx webserver via a form POST using XHR2 form data (and a cross-domain request with CORS). During mid-upload, the webserver returns a 408 ...
4
votes
0answers
912 views

How to debug CGI over fcgiwrap/nginx

I serve executable scripts (mainly in C) through fcgiwrap connected with nginx. Since the scripts are complied, I can get the coding errors during compilation, but sometimes I receive CGI errors ...
4
votes
0answers
2k views

Nginx as reverse proxy: how to properly configure gateway timeout?

We have configured Nginx as a reverse proxy to an Apache server farm, but I'm running into trouble with the gateway timeouts. Our Goal in human readable form is: "Deliver a request within one second, ...
4
votes
0answers
625 views

NGINX mod _proxy_html available?

Somebody created already a similar http://apache.webthing.com/mod_proxy_html/ mod_proxy_html module for Nginx? I think the closest module would be http://wiki.nginx.org/HttpSubsModule but I have no ...
3
votes
0answers
64 views

Suddenly started experiencing enormous wait times before requests hit server

Our web app has been getting 20k-30k views a day, and steadily growing. About 4 days ago we suddenly started seeing wait times of 30-40 seconds before the HTML was even being delivered, on pages that ...
3
votes
0answers
76 views

Nginx - SSL forward secrecy and iOS9 support

I'm trying to bring a couple of Linux web servers into line with the current recommendations for SSL - in particular for allowing iOS9 to connect. One server is CentOS 7, the other CentOS 6.4. I have ...
3
votes
0answers
117 views

Which permissions should I set to dhparam.pem?

I am generating Diffie-Hellman parameters for the ssl_dhparam directive in the SSL configuration of nginx. The file dhparam.pem is created with the command openssl dhparam 2048 -check -out dhparam....
3
votes
0answers
48 views

Regex location block not working in NGINX

I have a pretty simple location block in my nginx conf that looks like this: location ~* ^\/[a-z0-9]{24}$ { // do some things } I'm attempting to catch urls that end in a Mongo ObjectId. eg: ...
3
votes
0answers
19 views

Only log rate limit violations in nginx

Before enforcing per IP rate limits I wonder if there is a mode to only log violations without actually blocking clients. Therefore I could easilly check after some time that those parameters were ...
3
votes
0answers
86 views

Nginx, CakePHP: Error: Create the class Index.phpController below in file: App/Controller/Index.phpController.php

I've config nginx 1.4 for running cakephp 2.6, but it can't work. For every page, for example http://my-app/ or http://my-app/admin it always return the error: Error: Create the class Index....
3
votes
0answers
124 views

Query string parameters get shuffled

We're observing some strange behavior of the data send to our systems from a javascript since 9/9/2015. The problem shows up when the query string is send to our servers. Some values of the ...
3
votes
0answers
65 views

NGINX Worker Process, Burst Read Speed to only 1918kb/s

I am running an NGINX/1.8 server on Centos6.6 with multiple worker_processes, however while observing iotop I notice they burst up to 1918kb/s Read speed and rarely if at all pass that limit. I want ...
3
votes
0answers
225 views

Nginx: strip cookie from cached content

Trying to replace Apache by Nginx as a web proxy in front of some Tomcat servers, dealing with Set-Cookie JSESSIONID is proving to be challenging. Our Tomcat content is served with Cache-Control and ...
3
votes
0answers
116 views

Nginx setup on aws - redirecting to port 81, cannot reverse

I've tried to setup nginx on my free AWS instance so that it can host multiple domains on single ip address (not sure if it can be managed, but I'm trying to dig in). In that process I created ...
3
votes
0answers
672 views

How to override “Content-Type” header with PHP script on Nginx

I have some php script which returns jpeg image(1x1 pixel) with content type "image/jpeg": // return image $image_name = 'img/pixel.jpg'; $image = fopen($image_name, 'rb'); header('Content-Length: ' ....
3
votes
0answers
93 views

nginx error log :r eturned busy again while sending response to client,

I got lots of errors in my nginx errorlog as following: 2015/04/28 20:05:32 [alert] 67449#0: *29938935 sendfile(/var/www/images/201504/13/210123jpt6cpjj6r1g2upt.jpg) returned busy again while sending ...
3
votes
0answers
421 views

Execute lua script after getting response from proxy pass

I have nginx block which proxy passes the request to different load balancers based on the request by first calling a lua script. location / { set $provider_key null; set $cached_key null; set $...
3
votes
0answers
3k views

“echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message

One of my server (Ubuntu 12.04, 16CPU, 32GB RAM) runs the app section of my website (Nginx 1.1.19, PHP5-FPM, Php 5.3.10, Symfony2 Web Framework) Suddenly, users started getting HTTP 5** Errors. When ...
3
votes
0answers
390 views

Intermittent Connection Issues on High Traffic Servers

Some brief background: We've been getting reports of very intermittent connection issues from our users. Several times per day, users will have to reload the page they're on due to a connection ...
3
votes
0answers
2k views

Unable to apt-get install nginx-extras package on top of nginx 1.7.9

I am attempting to install Phusion Passenger for nginx on a dev Ubuntu box following this guide from the passenger website. I have Nginx installed and running already, version is 1.7.9-1~trusty. I ...
3
votes
0answers
185 views

fcgi to serve static files with nginx

Maybe I'm wrong, so before to ask my question, I'll explain a little what I'm trying to set up : I've a VPS where I want to have multiple users sites, with permission denied to all users to see the ...
3
votes
0answers
4k views

Disable IPv6 in nginx proxy_pass

My server doesn't have IPv6 adresses. However, when I use Nginx proxy_pass to upstream with IPv4 and IPv6, sometimes it tries to send outgoing requests using IPv6: 2013/07/30 00:25:06 [error] 1930#0:...
3
votes
0answers
1k views

nginx sticky sessions / ip_hash with Socket.io

I am to be load balancing two node.js/Socket.io instances on different boxes with nginx running a simple notifications service with a retroactive event for new clients. I don't think there will be ...
3
votes
0answers
700 views

nginx equivalent to Apache MultiViews?

If you put this in your .htaccess file Options MultiViews and you have these files stuff/ howto.html index.php items.php then all of these web addresses work /stuff/ # ...
2
votes
0answers
12 views

exclude IP from nginx access log

How to exclude some IP address from access log? This is my config: server { listen 443 ssl; [...] access_log /var/www/web/log/access.log; error_log /var/www/web/log/error.log; location / { ...
2
votes
0answers
85 views

google load balancer + nginx + symfony2

i'm trying to configure a scalable symfony2 app, so i read this page https://cloud.google.com/compute/docs/load-balancing/http/cross-region-example i did every thing like they said, is working with a ...
2
votes
0answers
52 views

Haproxy and nginx rtmp

i am trying to use haproxy in front of rtmp nginx server it does connect but it does not play the video i have 2 servers 1 server is where rtmp nginx installed and second server where haproxy ...
2
votes
0answers
34 views

What is the right way to host different Django apps as nginx locations

I have a static website (www.example.com) and a Django app (example.com/app1) running on a single server machine (machine 1). Both the website and the app are served using nginx. I am using gunicorn ...
2
votes
0answers
53 views

Any versions of ModSecurity that works with recent versions of Nginx?

I'm building Nginx and ModSecurity together in order to use the OWASP- Core Rule Set Project. According to the modsecurity download page, the latest version of modsecurity (2.9.1) is not stable when ...
2
votes
0answers
103 views

HSTS exclude specific subdomain with “includeSubdomains”

I'm using HSTS with this header on my website: Strict-Transport-Security: max-age=15768000; includeSubDomains This works as intended and forces the browser to redirect all http connections to ...
2
votes
0answers
55 views

502 Bad Gateway Error - exited on signal 11

I have an issue on a particular Magento store, on two different servers. The issue is that when I save admin panels, I get a 502 error. The values actually save to the database, as pressing back on ...
2
votes
0answers
32 views

How to distinguish between internal error code 502 and upstream returned http_502 on a nginx proxy

We use nginx as a http proxy server.The following configuration: location / { proxy_pass_header Server; proxy_pass $scheme://$http_host$request_uri; } When urls proxied return error code ...
2
votes
0answers
75 views

Nginx: How To Completely Disable Request Body Buffering

I'm trying to set up Madsonic on my Ubuntu box and have Nginx run in front of it. Problem is, I keep getting this warning when I try to upload stuff through the web interface: 31115#0: *14 a client ...
2
votes
0answers
90 views

Nginx reverse proxy with dynamic port forwarding

I'm setting up a reverse proxy on Nginx. I need it to listen to multiple ports. I then would like to hit the exact same port on the backend server. Like this: http://frontendserver:9000 -> http://...
2
votes
0answers
140 views

Forward Kerberos Authentication on Ansible

I have an ansible control machine (host-A) that need to talk with host-C, an Windows machine that doesn't have local users (It's an Active Directory). host-A doesn't have network access to host-C, ...
2
votes
0answers
74 views

PHP-FPM random timeout crashes

Similar questions have been asked about this but none have seemed to shed any light on this issue. I am using PHP 5.6.18 on Ubuntu 14.04. The server its on is an in-office server with an 8 core CPU (...
2
votes
0answers
35 views

nginx limit connections based on parameters

My website is a forum, and it has 3 type of URLs as below: Thread view: forum.php?mod=viewthread&tid=1256&page=2 Thread List: forum.php?mod=forumdisplay&fid=125&page=61 Display ...
2
votes
0answers
78 views

Combined redirects in Nginx

We are using Nginx and want to reduce the number of "chained" redirects we have. So, for example: URL A - http://www.sitename.co.uk/SHOPPING-CATEGORIES/product_name redirects to its https version (...
2
votes
0answers
163 views

Nginx in front of Varnish sometimes produces “upstream prematurely closed connection while reading response header from upstream” error

I have Nginx(1.9.9) on front of Varnish(4.1.0) on the same server. //nginx upstream varnish { server 127.0.0.1:8391; keepalive 16; } location ~ \.php$ { proxy_pass http://varnish; ...
2
votes
0answers
190 views

Set CORS headers on nginx

Addresses like http://vpsxxx.ovh.net/g/search?q=ok or http://vpsxxx.ovh.net/so/questions/34738694/how-to-move-items-on-the-screen-for-a-game-using-javascript are proxied well, when trying them from ...
2
votes
0answers
76 views

How to config nginx and uwsgi to cache a url any way?

Update2: add uwsgi_ignore_headers Cache-Control Set-Cookie X-Accel-Expires Expires Vary; and problem solved. Thanks everyone. Update: I tried uwsgi_ignore_headers Cache-Control Set-Cookie X-Accel-...
2
votes
0answers
114 views

Nginx proxy_pass to upstream uses sometimes IPv6 address

Why does Nginx proxy_pass to upstream send sometimes outgoing requests to IPv6? 2015/12/28 14:11:06 [error] 38194#0: *114469948 connect() failed (111: Connection refused) while connecting to upstream,...