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

3
votes
1answer
804 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
433 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
738 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
5k 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
5answers
6k 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 ...
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
9k 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
223 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
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 ...
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
992 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
1answer
2k views

How soon does nginx's token bucket replenish when limiting at requests per minute?

We've decided that we want to experiment and limit requests per minute instead of requests per second on our sites. However, I am confused by the burst parameter in this context. I am under the ...
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
634 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
0answers
321 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
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
495 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
511 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
231 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
0answers
149 views

restart nginx after modifying settings.py and urls.py

In my django project, I modified the files settings.py and urls.py. My web application runs on nginx server. I reloaded the server using the following command: /etc/init.d/nginx reload But the ...
0
votes
2answers
652 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
153 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
786 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
762 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
476 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
1k 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
547 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 ...