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
3answers
568 views

My webserver is getting flooded with invalid requests

My webserver (nginx) keeps getting requests like this: 23.244.104.206 - - [15/Jun/2014:21:21:47 -0400] "GET ...
1
vote
0answers
276 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
4k 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
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
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
3answers
7k 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 ...
1
vote
1answer
4k 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: ...
1
vote
5answers
4k views

How can I create a location in nginx that works with AND without a trailing slash?

Right now, I have this: location ~ ^/phpmyadmin/(.*)$ { alias /home/phpmyadmin/$1; } However, if I visit www.mysite.com/phpmyadmin (note the lack of trailing slash), it won't find what I'm ...
1
vote
2answers
4k 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 ...
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
455 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
507 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 ...
1
vote
3answers
5k views

nginx errors: upstream timed out (110: Connection timed out)

I have a nginx server with 5 backend servers. We serve around 400-500 requests/second. I have started getting a large number of Upstream Timed out errors (110: Connection timed out) Error string in ...
1
vote
4answers
227 views

Does Nginx need a unique ip address for every site served over HTTPS like Apache?

With Apache's the most common HTTPS setup you need 1 IP Address per site. Does Nginx have this same limitation or can a single IP Address serve an unlimited number of HTTPS sites?
1
vote
2answers
2k views

Nginx wont send POST to FastCGI backend, but GET works fine?

Not sure why, but it is happy sending a GET to the FastCGI backend (Mercurial hgwebdir in this case), but simply resorts to the filesystem if the request is a POST. Relevant parts of nginx.conf: ...
1
vote
5answers
2k views

How can I prevent hotlinking? (nginx)

I use nginx and I have no access to server conf. May be with .htaccess analogue?..
0
votes
1answer
1k views

Nodejs Nginx error: (13: Permission denied) while connecting to upstream [duplicate]

I'm trying to run multiple Nodejs applications on Nginx server running on CentOS 7. I noticed that when I run a Nodejs app on some ports I get an 502 Bad Gateway error in the browser so I checked the ...
0
votes
2answers
555 views

Can't get php-fpm with Nginx to work

Server: CentOs x86_64 /etc/php-fpm.d/webuser1.conf [webuser1] listen = 127.0.0.1:9001 listen.allowed_clients = 127.0.0.1 user = webuser1 group = webuser1 pm = dynamic pm.max_children = 15 ...
0
votes
1answer
148 views

Nginx as a reverse proxy + Apache or completely cut out Apache? (WordPress Multisite)

I am starting a WordPress multisite network with domain mapping and I am trying to think through my server set up. Right now, I only have one medium sized VPS but hopefully I will need to add more ...
0
votes
1answer
711 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 ...
0
votes
1answer
672 views

How can I setup nginx to serve virtualhosts with rails(unicorn/passenger) and php-fpm

I would like to serve multiple sites on one instance. I install nginx, php-fpm, and a rails app. I use sites like this to guide me. I configure php-fpm to listen to a local socket listen = ...
0
votes
2answers
422 views

Nginx how to disable multithread downloads

I was wondering if its possible to disable multithread downloads on nginx. Right now users can use download managers to download a file by splitting a file and I was wondering how I can prevent that ...
0
votes
1answer
967 views

nginx dynamic virtual hosts

With nginx is there a method to setup mass dynamic virtual hosts similar to the way apache2 can be configured? I'm setting up an saas application each user will have their own subdomain and i'd like ...
0
votes
1answer
540 views

Add www to non-www address with ssl

I would like all traffic without the www, including https, to be redirected to the respective url with the www. So http://example.com -> http://www.example.com, https://example.com -> ...
0
votes
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 ...
0
votes
2answers
873 views

nginx not acknowledging passenger_root option

I'm running a sinatra app on passenger, and trying to hook it to nginx. The relevant part of my config looks like: http { passenger_root /path/to/gem; #this is a valid path passenger_ruby ...
0
votes
3answers
4k views

Why is it necessary to chmod o+r parent directory to fix 403 access forbidden error with Nginx and Passenger?

This may be an Nginx wrinkle, or it may be because I don't understand Unix permissions. We're using Hudson CI to deploy our staging instance. So RAILS_ROOT is /var/lib/hudson/jobs/JOBNAME/workspace. ...
9
votes
2answers
6k views

best way to debug nginx config file?

I have a bunch of rewrite rules that I have to port from apache to nginx. It's a rather painful process because I'm not able to see if my rewrite rules and "if" conditions are working as I want them ...
6
votes
3answers
2k views

nginx: optimum # of workers

I just bought a new server which will be running nginx, PHP, MySQL stack that will be serving fully-cached html requests 90% of the time and PHP/mysql requests otherwise through FastCGI. Stats on the ...
5
votes
1answer
927 views

Status code in nginx try_files directive

Is it possible to use the current status code as a parameter in try_files? For example, we try to provide a host specific 503 static response, or a server-wide fallback if it wasn't found: ...
4
votes
3answers
8k views

How to output variable in nginx log for debugging

I am testing nginx and want to output variables to the log files. How can I do that and which log file will it go (access or error).
4
votes
2answers
6k views

Why is my nginx alias not working?

I'm trying to set up an alias so when someone accesses /phpmyadmin/, nginx will pull it from /home/phpmyadmin/ rather than from the usual document root. However, everytime I pull up the URL, it gives ...
3
votes
2answers
422 views

select() hangs due to resource exhaustion - but what resource?

Connecting to my server via sftp sometimes results in a hang here: if (select(max+1, rset, wset, NULL, NULL) < 0) { which is line 1428 from openssh 5.2p1's sftp-server.c (main loop of ...
3
votes
4answers
980 views

Nginx. How do I reject request to unlisted ssl virtual server?

I have a wildcard SSL certificate and several subdomains on the same ip. Now I want my nginx to handle only mentioned server names and drop connection for others so that it'd look like nginx is not ...
3
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; ...
3
votes
3answers
5k views

nginx HTTPS WWW redirect to non-WWW

My SSL certificate is for mydomain.com, so i am trying to redirect all www.mydomain.com over to without www. Now, all these work: http://www.mydomain.com http://mydomain.com https://mydomain.com ...
3
votes
5answers
1k views

Which Is a Good Starting Point For Beginner? Apache, Nginx or Cherokee?

Any of these web server software i.e., Apache, Nginx and Cherokee is suitable for my website at the moment. And I am learning sysadmin to be able to manage my server (and not for a job). For a ...
3
votes
1answer
1k views

How do I DRY up this Nginx configuration?

I’m on Nginx 0.8.54 trying to achieve the following as DRYly as possible: Proxy straight to localhost:8060 if cookie no_cache is true or if request method isn’t GET. Otherwise serve static files ...
3
votes
3answers
2k views

Load balancing: Nginx, Varnish and HTTP sessions

I have to setup a load balancing system. At the moment I have two machines running Nginx 0.8.52, PHP-FPM (on unix socket) and an application based on PHP Symfony 1.4.11. On a third machine, I have to ...
3
votes
2answers
849 views

What's the best server to use with ASP.Net on Mono? [closed]

I am reconfiguring my website from scratch and basically I want it to run Mono(well, ASP.Net inside Mono) According to the Mono Project there appears to be two options, Apache or Nginx. Which one ...
3
votes
3answers
3k views

Nginx rewrite urls without redirection

I used rewrite directives below in nginx to rewrite urls of static files to external CDN server. rewrite ^/static/(css|images|js)/([a-z_\-\.]+)$ http://cdn.domain.com/$1_$2 last; It works but it ...
3
votes
5answers
2k views

nginx vs lighttpd for wordpress

Which web server would be more suitable for running a few instances of wordpress? They are both pretty easy to setup, so I am wondering mostly about performance. Would there be a difference? I think ...
2
votes
1answer
45 views

Why doesn't nginx like my $args?

I have a WordPress site located at mysite.com/blog, the files of which are located in /var/www/mysite/wordpress. Why, when I visit mysite.com/blog/test, does my nested location block only get hit if I ...
2
votes
1answer
1k views

Nginx: expires header not working

I'm having issues with the expires header field. The following nginx rules give me this header (no expire header). Ideas why the expires headers arn't being passed? Header for: /css/v1/afile.css ...
2
votes
1answer
3k views

Nginx startup fails ssl no such file or directory

Here is the error I'm getting: Reloading nginx configuration: nginx: [emerg] SSL_CTX_use_certificate_chain_file("/path/to/cert.pem") failed (SSL: error:02001002:system library:fopen:No such ...
2
votes
1answer
2k views

My nginx rewrite is downloading the php file

I have the following rewrite rule I'm trying: location / { index index.php index.html; rewrite ^/test$ /test.php break; } And I ...
2
votes
0answers
338 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 ...