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 get nginx with proxy_pass and if_modified_since to return a 304-Not Modified

I see indications that this should work, so I'm hoping I'm missing something simple. We have two nginx "servers", a proxy_pass cache in front and an SSI server behind it. If I go directly to the SSI server with an If-Modified-Since header in the…
Kevin G.
  • 209
  • 3
  • 12
5
votes
1 answer

Vagrant / chef - nginx cookbook extend

I am fairly new to using chef, particularly with vagrant so this will most likely be a silly question to the more experienced users out there. I am using this cookbook: https://github.com/opscode-cookbooks/application_nginx I simply want to add my…
5
votes
2 answers

nginx gzip enabled but not not gzipping

I have gzip enabled on nginx 1.2.8, but for some reason, it is not gzipping anything. Nginx install info: nginx version: nginx/1.2.8 built by gcc 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) TLS SNI support enabled configure arguments:…
F21
  • 706
  • 3
  • 11
  • 20
5
votes
2 answers

Gzip compression with nginx

In my nginx.conf I have: gzip on; gzip_static on; gzip_buffers 16 8k; gzip_comp_level 9; gzip_http_version 1.0; gzip_min_length 1000; gzip_types text/plain text/css image/x-icon image/bmp image/png image/gif…
Jerry
  • 61
  • 1
  • 1
  • 3
5
votes
3 answers

Where to put project files with nginx

Looking at the /usr/share/doc/nginx/README.Debian file, we can see this warning: README for Debian ----------------- Files under /var/www/ are not supported as per Debian Policy. Please see:…
astorije
  • 183
  • 3
  • 9
5
votes
1 answer

nginx url rewrite with string substitution

I need to catch if my urls contain a small substr, keep the url as it is and rewrite only that small part, how can I accomplish this? For example: http://foobar.com/foo-bar-substrtocatch-baz should…
ngw
  • 1,261
  • 3
  • 13
  • 15
5
votes
4 answers

How do I enable PHP’s flush() with nginx+PHP-FPM?

I’m using nginx with PHP-FPM (APC is installed). I need PHP’s flush() to work. Is this possible? Things I’ve tried so far: Disabling all output buffering in php.ini, as well as output compression. Disabling gzip in nginx’s configuration. Setting…
Abraham Vegh
  • 1,045
  • 5
  • 17
  • 26
5
votes
1 answer

Best way to set up permissions with nginx + php-fpm on shared hosting?

I'm running a shared hosting server with nginx and php-fpm on Debian. Everything works fine, php-fpm has separate pools for each users running as separate users and they each have their own socks. Nginx is however running as www-data because I don't…
dBi
  • 75
  • 2
  • 4
5
votes
1 answer

Nginx rewrite *.html to *.php

I've setup my first Nginx site and the important rewrites are all done. They had to be manual, no rules would possibly have handled it, so I have a raft of rules like this to handle old URLs that might be indexed or bookmarked: rewrite…
5
votes
1 answer

Is there any soft / hard limit on the number of virtual hosts that Nginx can handle?

And what are performance implications? Is it practical to host tens of thousands of vhosts on one Nginx instance? How much would the increased latency be? We plan to offer custom domains for users, and to assign different chroot per user and to…
kenn
  • 665
  • 1
  • 6
  • 10
5
votes
2 answers

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 /var/www/domain.name/ Inside that directory, there will be a…
Rsaesha
  • 360
  • 3
  • 11
5
votes
2 answers

service static files under nginx & HTTP-Authentication

I have an app deployed in testing mode on a server. Access to it has been restricted to a select group of users via HTTP-Authentication. That works fine. The problem is that if I serve static files via different 'location' directive, nginx gives me…
5
votes
3 answers

Leverage proxy caching with nginx by removing Set-Cookie header

The following is a result of a bug within WebKit's Dev Tools used by Google Chrome and Apple's Safari. I have made a bug report with CrBug, who then identified the regression within WebKit Changeset 116952. I would like to thank @Grumpy and…
Mark Tomlin
  • 650
  • 3
  • 10
  • 23
5
votes
1 answer

Can I set up nginx to implement SSI-like functionality?

All my pages have similar static header and footer parts inside the body tag. head tags are similar too, but feature title, keywords and description which differ between pages. Can I use nginx to compose the output file taking parts of it from…
Ivan
  • 3,398
  • 19
  • 50
  • 71
5
votes
3 answers

NGINX : Cache when X-Accel-Expires is set

I have added a X-Accel-Expires header on my static contents as well as a Last-Modified header. I would like to know whats the correct setting to cache those elements without caching anything else. This is what I have at the moment but it doesn't…
mnml
  • 337
  • 1
  • 7
  • 21