Questions tagged [nginx]

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

Nginx is a web server and mail proxy known for its high performance and small resource footprint. It is used in many places as a replacement to Apache and also as a front end server to static content or reverse proxying. Nginx is developed under a BSD-like license by Kazakhstani developer Igor Sysoev.

Nginx comes with diverse modules that enable it to perform various different tasks such as load balancing, URL rewriting, request rate limiting, content compression, raw TCP proxying and integration with tools like memcached or scripting languages like Lua.

Nginx is being used by some of the worlds busiest sites like WordPress, Sourceforge, Github and Reddit. Its market share has been raising from 7% in 2008 to over 30% as of June 2016 according to W3techs statistics.

After nine years of development, Nginx 1.0 stable was released on April 2011.

17017 questions
5
votes
3 answers

How to remove "Client-Peer" (etc) header in nginx with php-fastcgi

My setup: OS: Ubuntu 11.04 HTTP Server: nginx 1.2.1 compiled with the HttpHeadersMore module processing PHP via php-fastcgi (other irrelevant software - ruby, python, etc) My problem: I'm trying to completely mask the software which serves the…
clinton3141
  • 163
  • 1
  • 6
5
votes
1 answer

Global nginx error pages without redirect

I'm wondering if it's possible to have a global error_page directive in nginx without redirecting (changing the URL in the browser's address bar). I know this is possible by using a named location, but global error pages are declared in the http…
nuceman
  • 51
  • 1
  • 3
5
votes
2 answers

Phpmyadmin location for nginx

I installed nginx and phpmyadmin. I set up a domain with these parameters to test phpmyadmin: server { listen 80; server_name example.com; root /usr/share/phpmyadmin; index index.php; fastcgi_index index.php; location ~ \.php$ { include…
MultiformeIngegno
  • 1,687
  • 9
  • 26
  • 31
5
votes
1 answer

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: error_page 503 @error503; location @error503 { root…
Hamish
  • 161
  • 1
  • 5
5
votes
2 answers

How to setup phpmyadmin with nginx and access it from http://vps-ip/phpmyadmin

The phpmyadmin files are located here /usr/share/phpmyadmin/ And I have this server block code that allows me to access phpmyadmin only from http://vps-ip/: server { listen 80; ## listen for ipv4; this line is default and implied …
Danny
  • 125
  • 2
  • 11
5
votes
12 answers

Optimum way to serve 70,000 static files (jpg)?

I need to serve around 70,000 static files (jpg) using nginx. Should I dump them all in a single directory, or is there a better (efficient) way ? Since the filenames are numeric, I considered having a directory structure like: xxx/xxxx/xxx The OS…
Ahsan
  • 103
  • 1
  • 1
  • 7
5
votes
2 answers

Cache-control for permanent 301 redirects nginx

I was wondering if there is a way to control lifetime of the redirects in Nginx? We would liek to cache 301 redirects in CDN for specific amount of time, let say 20 minutes and the CDN is controlled by the standard caching headers. By default there…
gansbrest
  • 835
  • 2
  • 9
  • 17
5
votes
4 answers

Can nginx be an mail proxy for a backend server that does not accept cleartext logins?

Can Nginx be an mail proxy for a backend server that does not accept cleartext logins? Preferably I'd like to know what directive to include so that it will invoke STARTTLS/STLS, but communication via IMAPS or POP3S is sufficient. relevant(?)…
84104
  • 12,905
  • 6
  • 45
  • 76
5
votes
2 answers

Disable FastCGI Read Timeout in Nginx?

Is there a way to disable the read timeout for FastCGI? (fastcgi_read_timeout) Setting it to zero does not work and just causes an immediate timeout. Nginx 1.0.5 PHP-FPM 5.3.6-13ubuntu3.6 The reason I need to get around the timeout is because of…
Kevin Herrera
  • 175
  • 1
  • 5
5
votes
1 answer

Mass 301 redirect URLs with Nginx

I have a list of 600 urls. Due to a change in the system the urls will change to a new format. I will have a list with the old urls and corresponding new ones. But how do i 301 redirect all of them? example: /news/post-name ->…
Jim
  • 410
  • 4
  • 14
5
votes
2 answers

Load balance HTTP based on a percentage of traffic or requests?

I want to have v1 of my application in one pool and version v1.1 in another pool and then slowly ramp up the traffic going to pool two and reduce it to pool one. Can anyone show some concrete examples of doing this with HA Proxy, Varnish, Nginx or…
markba
  • 85
  • 1
  • 6
5
votes
2 answers

nginx ignores my include directive?

I'm currently migrating from Apache to nginx. I have a couple of domains that are going to be hosted on the same machine with one IP address. Though I've configured nginx --prefix=/my/path it seems that nginx doesn't include my vhost configuration…
tftd
  • 1,498
  • 7
  • 25
  • 40
5
votes
1 answer

Limit requests per minute in nginx

I would like to set a limit on the number of requests a single client IP address can make to my server, based on their IP address. Nginx has a limit_req_zone directive. However, this directive will actually limit the average hits. If I set my limit…
Jeroen Ooms
  • 2,239
  • 8
  • 34
  • 51
5
votes
1 answer

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: https://a-alpha/omber/nms So I guess what I need is to rewrite requests…
Lukasz
  • 472
  • 2
  • 10
  • 18
5
votes
2 answers

Is there an access log for fastcgi?

I'm trying to set up a global location in nginx. It all works perfectly right now, other than PHP scripts requiring fastcgi. They're running a 404. Is there a way I can see the exact path it's accessing so I can try to debug this a bit and figure…
Rob
  • 2,393
  • 9
  • 33
  • 52