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

Correct way to handle security threats to web server on budget

During our annual security review I was reminded of an incident earlier this year where we received a threat to our organizations web server. It was over a organization policy and threatened to DDoS our site. Fortunately, nothing bad came of it and…
lswim
  • 183
  • 4
5
votes
1 answer

Nginx: Detect HTTPS connection using a header

On my load balancer I terminate HTTPS connections with Nginx and then proxy the request to one of the web servers which are also backed by Nginx. On the load balancer in fastcgi_params I have: fastcgi_param HTTPS $https; On the web servers…
Jason Christa
  • 622
  • 4
  • 11
  • 21
5
votes
1 answer

Regular expressions in server_name with Nginx vhost

I have something I'm trying to do with Nginx. Say I have a few users and a subdomain, and each user has a directory at /home/dev/sites/USER_ID. I would like for USER_ID.dev.example.com to point to that directory. I've tried making a vhost files as…
SharkofMirkwood
  • 152
  • 1
  • 1
  • 5
5
votes
1 answer

Reloading New Nginx Configuration With No Downtime

I have a Nginx server which constantly deals with high loads of requests. I want to be able to alter the configuration file of the server and reload it dynamically with zero downtime. I am running the following line in the shell: httperf…
Erez Rabih
  • 153
  • 1
  • 4
5
votes
2 answers

Nginx + WordPress : 414 Request-URI Too Long

I use Nginx with php-fpm on my server to run my Wordpress blog. When someone share my website on Facebook, some parameters are added by Facebook and the URL looks like :…
5
votes
2 answers

Need HAproxy + Varnish + nginx setup suggestions

Currently, I have two load balancers running HAProxy, which forward requests to backends, each of which run Varnish cache in front of nginx. I thought this would distribute most the bandwidth across the backend servers, but my load balancers appear…
Lin
  • 2,909
  • 7
  • 27
  • 25
5
votes
1 answer

How do I debug this Nginx to uWSGI timeout?

I'm running a database-backed web site that receives very little traffic. However, once or twice day, a request will timeout and I'll see this (or a similar) error in Nginx's error.log: 2013/06/13 18:32:40 [error] 16723#0: *27796 upstream timed out…
skyler
  • 465
  • 3
  • 8
  • 17
5
votes
4 answers

nginx is cutting the end of dynamic pages and caching them

I moved one of my old sites from an Apache to an nginx server. Everything is working fine but the site has some long content (a +100k generated HTML file). My first trial was to disable chunked transfer encoding, but that did not help. Here it is my…
oliver nadj
  • 171
  • 2
  • 8
5
votes
7 answers

Both servers running keepalived become master and have a same Virtual IP

Both two servers started keepalived, and the BACKUP server transited to MASTER STATE immediately. both two became MASTER now. Both two nodes are sending VRRP advertisement msg. on master server: [root@zhsq1 ~]# tcpdump -c 3 -i em1 host…
riverhuang82
  • 103
  • 1
  • 1
  • 5
5
votes
2 answers

Do multiple Nginx servers load balance the same IP address to the same backend with the ip_hash directive?

I have two separate Nginx machines. The domain uses round-robin DNS and has two A records, one for each of the two frontend Nginx server. Both Nginx servers use the ip_hash directive and proxy requests to the same backend servers. Will an IP…
Justin Meltzer
  • 711
  • 1
  • 9
  • 19
5
votes
1 answer

Problems setting a cookie from a machine proxied by nginx

For a project of mine, I need to wire up a long chain of machines that are essentially proxying the HTTP requests for each other. It goes like this: Web client - A - B/C - D When a request is made from the browser, it first goes through a thin…
Preslav Rachev
  • 151
  • 1
  • 1
  • 4
5
votes
2 answers

How to generically remove the www of the domain in nginx?

I have a server config in nginx which matches several domains: server { server_name example1.com example2.com example3.com; # ... } And I would like to redirect the www versions to the corresponding domains. I know how to do it for a single…
Happynoff
  • 193
  • 1
  • 6
5
votes
1 answer

How to make Nginx forward the original host name

I have an nginx server acting as a load balancer for my apache servers. I am using subdomains and my code relies on the HTTP_HOST value to perform the correct task. When i make a request to say: http://get.example.com once it is forwarded the…
Ibu
  • 153
  • 1
  • 6
5
votes
2 answers

Why is nginx serving the wrong MIME-type for requests in directory alias?

If there is a way to do this typical task without using aliases, I'm all for it. I want all requests at the /minesweeper/* URL to be pulled from a completely different directory than other requests. The following configuration WORKS, files are…
Michael Butler
  • 161
  • 1
  • 1
  • 6
5
votes
3 answers

Security issue on Nginx, PHP & fastcgi_split_path_info

According to this post, it was said that if I am using PHP/Nginx, for better security, I should either cgi.fix_pathinfo = 0 or if ( $fastcgi_script_name ~ \..*\/.*php ) { return 403; } In other tutorial it recommend the style of…
Howard
  • 2,135
  • 13
  • 48
  • 72