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
35
votes
1 answer

Constantly have to reload PHP-FPM

We have a fairly heavily loaded server running nginx and PHP-FPM. We have 6 websites on this server, running PHP-FPM and nginx. Software is all vBulletin 3.8 and WordPress. Databases are on a separate server. Now, because these are highly popular…
Kevin
  • 827
  • 3
  • 13
  • 23
35
votes
6 answers

Disable IPv6 in nginx proxy_pass

My server doesn't have IPv6 adresses. However, when I use Nginx proxy_pass to upstream with IPv4 and IPv6, sometimes it tries to send outgoing requests using IPv6: 2013/07/30 00:25:06 [error] 1930#0: *1482670 connect() to…
Anton
  • 451
  • 1
  • 4
  • 5
35
votes
3 answers

How to set a favicon.ico for a specific Virtual Host on Nginx?

I am using Nginx as my webserver for the first time. I didn't have any trouble to set it up and everything works great. The problem came when the designer asked me if he could send me "the icon in the title bar" to "put it up there". #…
ersamy
  • 453
  • 1
  • 4
  • 5
34
votes
5 answers

How to handle relative urls correctly with a nginx reverse proxy

Sure I'm not the first one that tried to serve a domain example.com from a example.net/bbb, but I haven't found a solution yet. My NGINX configuration follows the guidelines and looks something like this: server { listen 80; server_name…
a.barbieri
  • 483
  • 1
  • 5
  • 7
34
votes
3 answers

How to totally remove a certbot-created SSL certificate?

I use Ubuntu 16.04 with Nginx and I've installed Nginx Certbot on my operating system (Ubuntu 16.04) with: apt-get update -y add-apt-repository ppa:certbot/certbot -y apt-get update -y apt-get upgrade python-certbot-nginx -y I setted Nginx…
Arcticooling
  • 1
  • 3
  • 7
  • 22
34
votes
2 answers

nginx config file line continuation?

I've got an nginx config stanza that looks like: server { listen *:80; server_name domain1.com domain2.com domain3.com domain4.com .... domainN.com; rewrite ^(.*) http://my_canonical_domain.com permanent; } with lots of different…
Roy Smith
  • 493
  • 1
  • 5
  • 6
34
votes
1 answer

What is the name and location of the Nginx config file (htaccess equivalent)?

There are many tutorials on how to write Nginx rewrite rules to mimic Apache's .htaccess file but I can't confidently say I know what the name or location of this so-called Nginx config file actually is. I'm specifically looking for the Nginx config…
tim peterson
  • 693
  • 2
  • 9
  • 18
34
votes
2 answers

Allowing cross origin requests (CORS) on Nginx for 404 responses

I'm using Nginx to serve static files in response to CORS requests using the technique outlined in this question. However, when the file doesn't exist the 404 response does not contain the Access-Control-Allow-Origin: * header and so is block by the…
alnorth29
  • 443
  • 1
  • 4
  • 5
34
votes
1 answer

How to disable http basic auth in nginx for a specific ip range?

I'm developing an application with facebook login. So far it's not public and is protected by http basic auth in nginx. Is it possible to disable http auth for facebook's ip range so that we can have our tester test the facebook capabilities as…
VoY
  • 1,275
  • 2
  • 11
  • 9
34
votes
2 answers

nginx automatic failover load balancing

I'm using nginx and NginxHttpUpstreamModule for loadbalancing. My config is very simple: upstream lb { server 127.0.0.1:8081; server 127.0.0.1:8082; } server { listen 89; server_name localhost; location / { …
robinmag
  • 463
  • 1
  • 5
  • 8
33
votes
5 answers

How do I remove a server-added header from proxied location?

I have an Nginx proxy setup where I add several security-related headers to the server so that they return on all proxy locations. On some locations I need to add additional headers (ex. Content-Security-Policy to /), while on other specific…
kspearrin
  • 463
  • 1
  • 4
  • 8
33
votes
7 answers

Why is Nginx so fast?

How does a site like rambler serve dynamic content so fast? Even faster than Yahoo (which has a server in my country- SE Asia; rambler does not). Is this purely Nginx’s capability? Where should I be looking into to learn about such capabilities? …
Quintin Par
  • 4,373
  • 11
  • 49
  • 72
33
votes
3 answers

Nginx configured with http2 doesn't deliver HTTP/2

I have a problem with my Nginx configuration. I upgraded to nginx 1.9.6 to test http/2 but it does not work on my server. I used ubuntu 14.04.2 LTS This is the nginx -V output : nginx version: nginx/1.9.6 built with OpenSSL 1.0.2d 9 Jul 2015 TLS SNI…
throrin19
  • 383
  • 1
  • 3
  • 8
33
votes
2 answers

Modify HTML pages returned by nginx reverse proxy

I have a reverse proxy setup for access to a third party application located inside a intranet from the internet. Let's say this application is on the URL: https://internalserver:8080/ (reachable only from the intranet) and the proxy is…
PCJ
  • 433
  • 1
  • 4
  • 5
33
votes
2 answers

Do HTTP reverse proxies typically enable HTTP Keep-Alive on the client side of the proxied connection and not on the server side?

HAProxy has the ability to enable HTTP keep-alive on the client side (client <-> HAProxy) but disable it on the server side (HAProxy <-> server). Some of our clients connect to our web service via satellite so the latency is ~600ms and I think that…
LostInComputer
  • 497
  • 1
  • 4
  • 10