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

5
votes
2answers
15k views

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

I have a server which was working ok until 3rd Oct 2013 at 10:50am when it began to intermittently return "502 Bad Gateway" errors to the client. Approximately 4 out of 5 browser requests succeed but ...
5
votes
2answers
706 views

nginx clobbering sftp traffic during peak times - is tc the answer?

This is probably a continuation of my previous (unanswered) question because the underlying cause is probably the same. I have a Linux server with nginx and sshd running on it. It's on a shared ...
5
votes
1answer
3k views

How to extract Only the file name from the request uri

I am trying to rewrite the request uri depending on the extension of the file, then extract only the file name from the uri and store it in another folder. The problem here is no predefined variable ...
5
votes
4answers
4k views

limit bandwidth and space usage of each Virtual Host?

I am starting a small web hosting company to teach me about system administration and one of the problems I am having is how would I limit the bandwidth and disk space of each virtual host ...
4
votes
1answer
384 views

Heartbleed, which specific services must be restarted?

Trying to figure out exactly what services should be restarted after patching openssl against Heartbleed. At least one post mentions restarting: sshd, apache, nginx, postfix, dovecot, courier, ...
4
votes
2answers
2k views

nginx permission denied to certificate files for ssl configuration

I'm installing an nginx ssl proxy on my Fedora server. I've created a cert and key pair under /etc/nginx. They look like this: ls -l /etc/nginx/ total 84 ... -rw-r--r--. 1 root root 1346 Sep 20 ...
4
votes
2answers
933 views

Deploying Django App with Nginx, Apache, mod_wsgi

I have a django app which can run locally using the standard development environment. I want to now move this to EC2 for production. The django documentation suggests running with apache and ...
4
votes
2answers
2k views

How to tell nginx to serve https only for one vhost-managed domain?

I have an ec2 instance running ubuntu and nginx 0.8.4, with vhosts serving several different domains using http but one using SSL/https. Secure domain configuration: server { listen 443 ssl; ...
4
votes
2answers
4k views

nginx proxy pass redirects ignore port

So I'm setting up a virtual path when pointing at a node.js app in my nginx conf. the relevant section looks like so: location /app { rewrite /app/(.*) /$1 break; proxy_pass ...
3
votes
0answers
1k views

Munin dynamic graph zoom (dynazoom) not working (Nginx, PHP-FPM)

Debian 7.5 Nginx/1.6.0 PHP 5.6.0RC2 (fpm-fcgi) (built: Jul 11 2014 08:17:52) Munin v2.0.21-2 I been searching all over the net for a few days for answers to my problem but it seems like no one knows ...
3
votes
1answer
877 views

Splitting long lines in a nginx configuration file

In order to not pass garbage to the back-end, I have a strict regex for a location directive. It looks like this: location ^~ ...
3
votes
2answers
503 views

How to check multiple CRL lists with nginx client authentication?

I have a custom easyrsa setup with a root and three CAs signed by the root. (Three different sub-cas depending on the user type), like this: RootCA +----- AdminUserCA +----- EmployeeCA +----- ...
3
votes
2answers
777 views

Why put a reverse proxy in front of a WSGI server?

A typical configuration for deploying a WSGI application includes a WSGI server (such as uWSGI or Gunicorn) behind a general-purpose web server (like nginx) that acts as a reverse proxy. One major ...
3
votes
2answers
6k views

Nginx $document_root$fastcgi_script_name vs $request_filename

I can't notice any difference if in my config file I set fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; Or: fastcgi_param SCRIPT_FILENAME $request_filename; What do ...
3
votes
2answers
4k views

Prevent nginx from redirecting traffic from https to http when used as a reverse proxy

Here's my abbreviated nginx vhost conf: upstream gunicorn { server 127.0.0.1:8080 fail_timeout=0; } server { listen 80; listen 443 ssl; server_name domain.com ~^.+\.domain\.com$; ...
3
votes
2answers
5k views

How do you conditionally include files in Nginx vhost?

In the lines below, I might have a site-specific configuration file that contains additional fastcgi_params unique to that site. If this file exists I want to load it. server { listen 80 ...
3
votes
3answers
1k views

Is it possible to route requests to different applications via Content-Type?

I'm designing a JSON API, and I'd like to version the API using content negotiation of some kind. I'm currently planning on using Vendor MIME Types to do this. While I can definitely do this at the ...
3
votes
2answers
2k views

PHP-Mcrypt Installation

I need to install php-mcrypt on my CentOS 5.5 VPS, When I try yum install php-mcrypt, it says that it is set to be updated which implies that it is already installed. I looked in the ...
3
votes
4answers
3k views

How to add a pool to FPM (nginx) without reload/restart fpm itself?

Im building an environment (on a ubuntu 10.04.02 machine) to handle a website with many (should support at least 1000) subdomains, each of them served by a different FPM pool, with a different user. ...
3
votes
1answer
10k views

How to permanently redirect port 8080 URL to port 80 using nginx

Because of my carelessness, I put http://www.domain.com:8080/xxx/index.html on the internet. I don't want to lose that traffic, so i want to permanent redirect that url to ...
3
votes
1answer
6k views

nginx- Rewrite URL with Trailing Slash

I have a specialized set of rewrite rules to accommodate a mutli site cms setup. I am trying to have nginx force a trailing slash on the request URL. I would like it to redirect requests for ...
2
votes
2answers
229 views

Forward all TLD requests to another server

So, an emergency has been landed in my lap, and unfortunately I'm ill-equipped to deal with it. An IT tech for a client's company changed the A record for a domain, then went on holiday. He is the ...
2
votes
1answer
4k views

How to setup a subdomain on nginx? [closed]

I have setup GitLab on my unbuntu ubuntu 12.04 lts server in following path /home/git/gitlab/. I am using nginx server. This is my gitlab status root@c27-76:/etc# sudo service gitlab status The ...
2
votes
2answers
2k views

Running sinatra program [Kibana] behind nginx reverse proxy in web directory

I'm trying to get Kibana to run behind nginx within a specific web directory. Or, put another way, I'm trying to have nginx reverse proxy http://example.com/kibana to http://localhost:5601/, which is ...
2
votes
3answers
8k views

Nginx serving content from the wrong “virtual host” while accessing with https

I have a server running both Nginx and Apache in a proxy setup, Nginx serves the static content and Apache the dynamic content which works really well. This setup is currently hosting two versions of ...
2
votes
1answer
5k views

Hide path to backend with Nginx

I have OpenNMS running on host B-beta with the following URL: http://b-beta:8980/opennms I would like to use NginX to hide this path accessible from host a-alpha like this: ...
2
votes
1answer
2k views

Rewriting a query-string part as a path part using nginx?

How do I rewrite URIs of the form /one/two?path=three&foo=bar to /one/two/three?foo=bar using nginx?
2
votes
1answer
5k views

403 Forbidden error on Mac OSX - Apache and nginx

There are a million questions like this on Google, but I haven't found a solution to my problem. The default Apache install on my Mac is giving 403 Forbidden errors for everything (default directory, ...
2
votes
1answer
3k views

Mixed IP and Name Based Virtual Hosts with nginx

I set up many domains but I dont know how to configure if only ip address is given. say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to ...
2
votes
1answer
1k views

Configure nginx to serve a 503 if a file exists

I'm trying to setup nginx to return a 503 if a particular file exists (probably something like "upgrading"). I'm trying to use the try_files directive, but when it finds the /upgrading.html file, it ...
2
votes
2answers
3k views

nginx better than apache for dynamic content? [duplicate]

Possible Duplicate: Apache or NGINX for PHP? Hi, i have searched for this around the web and i can't find the right answer for my question. basically i want to know if i can get better ...
2
votes
3answers
2k views

Determine nginx reverse-proxy load limits

I have an nginx server (CentOS 5.3, linux) that I'm using as a reverse-proxy load-balancer in front of 8 ruby on rails application servers. As our load on these servers increases, I'm beginning to ...
2
votes
2answers
645 views

my first “production” debian server configuration

I have been using Debian for a year, mostly as the distro for my internal company server. Now I am making a public e-commerce website and I am planning to use a dedicated Debian server at a datacenter ...
1
vote
1answer
1k views

Nginx dynamic proxy_pass doesn't resolve properly

I'm having problems configuring nginx, I've searched the web for solutions and I have some bits and pieces but I'm still not able to come up with proper configuration. I have registered a domain, ...
1
vote
1answer
722 views

Errors when Compiling Nginx with Pagespeed on CentOS 7

I am trying to compile Nginx with Pagespeed from source and I am having a hard time trying to resolve the not found errors I am seeing when I add the configure settings. This is my configure settings: ...
1
vote
2answers
803 views

Async ignored on AJAX requests on Nginx server [closed]

Despite sending an async request to the server over AJAX, the server will not respond until the previous unrelated request has finished. The following code is only broken in this way on Nginx, but ...
1
vote
0answers
326 views

Improving TCP performance over a gigabit network lots of connections and high traffic for storage and streaming services

I have two servers, Both servers hardware Specification are Processor : Dual Processor RAM : over 128 G.B Hard disk : SSD Hard disk Outging Traffic bandwidth : 3 Gbps network cards speed : 10 Gbps ...
1
vote
1answer
5k views

nginx + php fpm -> 404 php pages - file not found

*2037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream server { listen 80; ## listen for ipv4; this line is default and implied #listen ...
1
vote
2answers
2k views

nginx deny user agent causes error when not encapsulated in quotes

I'm trying to deny some user agents I constantly see probing my nginx web server. If I have this in my .conf file ## Block http user agent - morpheus fucking scanner ## if ($http_user_agent ~* ...
1
vote
2answers
2k views

Cannot access any svn file

I put directory svn and svn-auth in /var/www and already change owner and set permission with chown -R apache.apache /var/www/svn* and chmod 600 -R /var/www/svn* My configuration ...
1
vote
1answer
830 views

How to prevent nginx from locking files on mounted samba partition in Centos 6

I'm using nginx 1.3.8 inside a centos 6.3 virtualbox 4.2.4 virtual machine. The system is running the latest software available via yum update. The host OS is windows 7. The site files nginx is ...
1
vote
2answers
2k views

FreeBSD Listen Queue Overflows - can't increase max queue size

I have a decently high trafficked FreeBSD Nginx server, and I'm starting to get a large number of listen queue overflows: [root@svr ~]# netstat -sp tcp | fgrep listen 80361931 listen queue overflows ...
1
vote
1answer
2k views

Nginx rewrite rule (subdirectory to subdomain)

I would like to redirect admin subdirectory to a subdomain. I tried to create this rule for Nginx however it's not working: location ^~ /admin/ { rewrite ^/admin(.*) ...
1
vote
3answers
2k views

NGINX sub domain proxy pass

Version: nginx/1.2.0 || (I know the risks, its for a internal server) How would I setup a system where 17.hostname.com would be put as proxy_pass http://192.168.56.17:80 (Where 17 would be replaced ...
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 ...
1
vote
2answers
3k views

Combine several locations with regex in nginx

I dynamic number of Joomla installations in subfolders of the domain. For example: http://site/joomla_1/ http://site/joomla_2/ http://site/joomla_3/ ... Currently I have the ...
1
vote
2answers
1k views

Nginx, awstats and request time

How can I tune nginx to write request time to logs such that awstats can show time taken for each request? Also, how can I see requests by time taken in awstats? This is the current format ...
1
vote
1answer
2k views

What IP does nginx use for ip_hash sticky sessions?

Does nginx use the direct client's IP for ip_hash, or does it also observe X-forwarded-for HTTP header to use as the IP address to ip_hash? For example, in a situation where some clients using a ...
1
vote
1answer
504 views

How to make nginx remap a part of the URL without sending a redirection?

I have pictures on a path looking like this: /0/1/2/3/4/01234/screenshots/1.jpg The URL to access it looks like this: /static/0/1/2/3/4/01234/screenshots/1.jpg I'd like it to look like this: ...
1
vote
2answers
514 views

Awstats logformat typo?

I've been through the awstats docs for a while now, it just seems to be failing with the Logformat. I'm using the following in awstats, LogFormat = "%host - - %host_r %time1 %methodurl %code %bytesd ...