nginx (pronounced "engine-x") is a lightweight, high-performance Web server and reverse proxy as well as IMAP/POP3 proxy server.

learn more… | top users | synonyms

1
vote
1answer
592 views

upstream sent more data than specified in “Content-Length” header while reading upstream

I have django app (based on Mezzanine). My nginx conf looks like: upstream myhost { server 127.0.0.1:8000; } server { listen 80; server_name www.myhost.ru myhost.ru; ...
0
votes
1answer
28 views

Add cookie in nginx

I have nginx server that serves as proxy for international requests and lives in .com domain. I have simple proxy configuration, where tradernet.com server proxies all incoming traffic to ...
0
votes
1answer
793 views

DNS failure crashing web site - CURL requests

My PHP keeps throwing random errors which relate to slow scripts. nginx/php5-fpm report in their error logs that the child has been terminated due to script timeout. PHP5-FPM slow error log reports ...
0
votes
1answer
40 views

Pass PHP5-FPM errors back to error page script?

My nginx has an error_page setup that throws 500 errors to a PHP page. I wish to display/log any PHP errors that cause this error page to show. When I say display, I mean show in-browser depending on ...
0
votes
1answer
23 views

NGINX: Lots of connection timed out Errors

I am getting this error a lot: 2014/11/26 21:01:30 [error] 3475#0: *4028 upstream timed out (110: Connection timed out) while reading response header from upstream Here is my configuration: user ...
0
votes
0answers
20 views

NGinx mp4 movie Streaming

I'm using NGinx 1.7.7 and i have the following config: user wwww-data; worker_processes auto; worker_rlimit_nofile 300000; events { worker_connections 6000; use epoll; } http { ...
0
votes
1answer
28 views

Synology Rackstation - Better way to mount it

We are using a Synology Rackstation storage to store our static content which is served by a 4x Nginx backend. Now we've mounted it by nfs4 like this: 192.168.0.20:/volume1/images2 ...
3
votes
1answer
948 views

Nginx Reverse Proxy Node.js and Wordpress + Static Files Issue

I have had quite a time trying to get nginx to serve static assets from my wordpress blog. Have a look at the config and let me know if you can help. ( https://gist.github.com/1130332 - to see the ...
7
votes
2answers
1k views

Nginx add_header for a 50* page

I'm currently trying to get nginx to add a header to the response when it is sending some kind of 50* error. I already have an add_header directive on the http block, and that gets respected for all ...
0
votes
0answers
18 views

Converting htaccess rewritecond to nginx

I'm very new to nginx, but have previous experience with apache redirects. I converting a subdomain to a subfolder and need some help with getting my rewrite rules correct for my switch. The subdomain ...
0
votes
0answers
14 views

Nginx start fail with no errors

I can't start my nginx (1.6.2) on Debian using service nginx start. I have 0 error, only FAIL as message. I checked my config using nginx -c /etc/nginx/nginx.conf -t and it's successfull. I have ...
0
votes
2answers
18 views

How to restrict a specified file on specified port in Nginx?

The web server is NginX, I need to do these: when accessing xxx.php from port 80, return 404; when accessing xxx.php from 8555(ssl connection), normal way. I've tried this way: server { ...
1
vote
2answers
884 views

redmine gives 404 on static files, works fine elsewise

I have followed http://linux.mickgenie.com/how-to-install-redmine-with-cpanel/ to install redmine on my cpanel box. Got it up and running fine except that it doesn't load any static files (js, css, ...
1
vote
3answers
4k views

Blocking 'good' bots in nginx with multiple conditions for certain off-limits URL's where humans can go

After 2 days of searching/trying/failing I decided to post this here, I haven't found any example of someone doing the same nor what I tried seems to be working OK. I'm trying to send a 403 to bots ...
15
votes
4answers
53k views

connect() failed (111: Connection refused) while connecting to upstream

I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this: 2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed ...
1
vote
1answer
29 views

Parse cookie by domain in NGINX

I have two cookies with same name userId on client. They differ only by domain set. One is tradernet.com and another one is .tradernet.com If I use $cookie_userId, nginx catches first one and it's ...
8
votes
2answers
10k views

What does this nginx error “rewrite or internal redirection cycle” mean?

tail -f /var/log/nginx/error.log 2013/05/04 23:43:35 [error] 733#0: *3662 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: _, request: ...
0
votes
1answer
13 views

NGiNX Custom Cache param based on regex match

My question(s) are as follows: How do I set custom variables based on regexp against a useragent? How do I set custom headers for the reverse-proxy request? How do I use these values as caching ...
0
votes
1answer
14 views

Running (and monitoring) nginx with supervisord

I will start with my use case, since I very well may not be using the correct tools for this job. Please let me know if I am going about this all the wrong way use case: I have a CentOS server ...
0
votes
0answers
17 views

NGINX ip_hash load balancing not working

I've set up NGINX to load-balance requests to my web app. One front end server passes requests to two backend servers. All works fine. However, I have been using the ip_hash directive to ensure users ...
1
vote
1answer
907 views

How to prevent nginx from reverse proxy specific subdirectories

On Apache you can ProxyPass everything except one or more subdirectories (with "!"). ProxyPass /subdir ! ProxyPass / http://localhost:9999/ What is the Nginx equivalent ? My first guess is ...
1
vote
2answers
2k views

A complicated nginx/php-fpm chroot setup

I'm running nginx and php-fpm, and I want to set up jails for each host. My setup is a little complicated, so following tutorials on the web gets me nowhere. Each site has a directory ...
1
vote
1answer
21 views

nginx and SSL redirect

I have a nginx server which I use as a proxy. I want to have all requests forwarded as normal http requests, expect request to api.mydomain.org, those request I want to run with ssl/https. This works ...
0
votes
1answer
31 views

Nginx conf failed cause of server directive not allowed

I have a problem with one of my vhost. When I restart nginx, it's fail. So I tried : nginx -c /etc/nginx/sites-available/website -t And here is my problem : nginx: [emerg] "server" ...
-3
votes
0answers
21 views

Nginx not working on first visit [on hold]

I currently have a CentOS 6.6 server with Nginx + Varnish (+ PHP-FPM 6.6) on it and tested all as succesfully running and working, except for Nginx which keeps acting up. The problem with Nginx ...
-1
votes
1answer
10 views

plesk - Loopback HTTP connections go to incorrect vhost

Running plesk 12 and noticed the default vhost log ( /var/log/httpd/access_log ) is full of these 404 errors: [25/Nov/2014:22:17:40 -0500] "POST ...
1
vote
2answers
1k views

Using a server_name variable in an nginx proxy_pass config

I have two back-ends with different data that I want to test my UI code against, so I'm trying to configure Nginx to allow me to switch between them based on URL. So for example, the local URL ...
0
votes
1answer
25 views

Drupal 7 Multi-site Sub-folders nginx configuration

I'm using perusio configuration for drupal but I think that is only designed for single web site. php does not work in subfolders. I want to create a structure as follows: Main site ...
1
vote
1answer
1k views

Nginx reverse proxy to external URL which have redirects in place

Afternoon gentlemen, My current setup is one single site, lets call that http://production.com, that's being served by Nginx on port 80 as a static cache and Apache in the background on port 8080 ...
1
vote
2answers
65 views

return error 410 for location regex? in nginx

I'm using nginx-1.6.2,2 and I'd like return error 410 for URL that matches /browse.php?u=http, so requests such as this will get 410: 162.218.208.16 - - [21/Nov/2014:12:35:40 -0500] "GET ...
0
votes
0answers
19 views

NGINX: Disk write spike and/or not enough workers error from sudden surge in traffic causing 500 errors

I have been trying to diagnose an issue we have on our production servers. We have a server running NGINX as a load balancer which splits requests between four application servers. At least a few ...
1
vote
0answers
49 views

NGINX using 100% of the server CPU when testing with Blitz.io

I'm facing an issue here and after four days of looking around I decided to ask for some help here, after all a million heads can think a lot better than one. I have a Ubuntu 14.04 server setup with ...
1
vote
3answers
79 views

nginx failed (13: Permission denied) uwsgi (502 bad gateway)

I am having trouble running my application on a new DigitalOcean droplet. The machine runs CentOS 6.5 My /etc/nginx/nginx.conf user nginx www-data; worker_processes 1; error_log ...
4
votes
2answers
432 views

How can I stop nginx from retrying PUT or POST requests on upstream server timeout?

We are using nginx to load balance requests to our application. We have found that nginx switches to a different upstream server when requests time out (good). However it does this for PUT and POST ...
0
votes
1answer
1k views

Forcing Nginx to send Content-Length headers when serving static files with gzip

We're running Nginx 0.7.65[-1ubuntu2.3]. I've just noticed that when serving local static files using an alias directive and gzip on, the Content-Length header is not getting sent. Since it's serving ...
2
votes
2answers
2k views

Adding “HttpOnly” and “Secure” cookie flags on Nginx & PHP

I have Nginx running with PHP and WordPress. Acunetix recommends setting these flags, but they provide no documentation. I have looked around a bit, but I have not seen anything that shows exactly how ...
0
votes
1answer
21 views

How do I configure nginx on RHEL to recognize root SSL certificates of external sites?

Setup: I have a nginx reverse proxy that is a load balancer for ASP.NET applications. The problem is when ASP.NET application tries to access an external application, the SSL handshake fails. I think ...
-1
votes
0answers
14 views

Nginx Module Post parse Request timeout [on hold]

I wrote a custom module for parse GET, POST, Cookie, Header request. This works fine but when I request by POST then first request working fine, after that second request not responding. going request ...
0
votes
1answer
979 views

nginx unknown directive ssl_protocols

I've compiled NGINX 1.4.1 with ssl support and wanted to secure my configuation with these lines: ssl_prefer_server_ciphers on; ssl_protocols        SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers          ...
-1
votes
1answer
43 views

Nginx Enable HTTPS/SSL when forwarding to other URL

Currently, I'm working with an AWS Ubuntu EC2 instance, running a Node.js app on port 3000, that has an Nginx reverse proxy. I have been trying to enable HTTPS and add a SSL certificate and I've been ...
0
votes
2answers
21 views

Nginx redirect last fragment in string

I'm struggling to get my head around how to rewrite the following url: http://example.com/blog/01-01-01/string to http://example.com/string The following regex matches the string - ...
-1
votes
0answers
15 views

How to add SSL certificate to domain that is URL-frame redirected to AWS EC2 server

Currently running a node.js webapp with a NginX reverse proxy on an Amazon EC2 web server instance. Furthermore, I have a domain, call it example.com, which URL-frame redirects to this web server. ...
-3
votes
1answer
25 views

nginx restart fails: [emerg] directive “pagespeed” is not terminated by “;” in /etc/nginx/vhosts.d/name.d/pagespeed.conf:14 nginx [on hold]

attempted to restart nginx to get this: [emerg] directive "pagespeed" is not terminated by ";" in /etc/nginx/vhosts.d/appname.d/pagespeed.conf:14 nginx. pagespeed.conf: pagespeed Domain domain.com ...
2
votes
1answer
407 views

Nginx Subdirectory Drupal + other app

I have a drupal app and 2 other app written in php, i want use a rewrite uri for drupal and place drupal in virtual root / and the other by their names ... and use the server cache for the img of each ...
0
votes
0answers
11 views

Block empty user-agents nginx?

My site was under attack and I noticed all the user agents are blank. How can I block this with my nginx? I have no idea what to block, if this is an empty user agent or what.
4
votes
2answers
2k views

How do I enable gzip Compression on NGINX PageSpeed Module resources?

I have been focusing heavily on optimizing a certain website so that it scores 100 on the Google PageSpeed Insights tool (for both mobile and desktop). Most of the items are working flawlessly, but I ...
0
votes
1answer
26 views

nginx: Append to proxied URL with proxy_pass

I'm dealing with some legacy issues where I have to reconfigure servers hosting a PHP based application. One of the decisions was to move away from Apache onto Nginx. Now the application hosts two ...
1
vote
1answer
32 views

SSL proxying on nginx — different behavior in different clients

I'm running an SSL-required web service and planning to switch hosting providers. To avoid downtime for our users while DNS caches clear, I'm planning to proxy requests from our old server to the new ...
0
votes
1answer
44 views

Nginx + LimeSurvey:

I'm trying to secure my Limesurvey 2.0.5 admin page (running under Ubuntu 12.04, Nginx 1.19, PHP5.3.10, PHP-FPM). The admin page should only be accessible from a specific subnet so in my conf I used ...
-6
votes
0answers
34 views

Convert Nginx rewrite to htaccess [duplicate]

Nginx rewrite: if (-d $request_filename) { rewrite ^/?$ /get_doc.php last; break; } if (!-e $request_filename) { rewrite ^/?admin /get_admin.php last; rewrite ^(.*)$ ...