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
0 answers

Access website hosted on same server as VPN via the VPN

I have just finished setting up a OpenVPN server running on Ubuntu 12.04 and I have been able to connect to it from my own computer (the client). I am able to set up the VPN server to route ALL traffic via the VPN with the push "redirect-gateway…
Titi
  • 230
  • 2
  • 6
5
votes
2 answers

Nginx: How to limit request rate based on user agent

Trying to get the following behavior working in nginx A default rate limit of 1r/s for each ip when using a browser. A rate limit of 10r/s for bing and google spiders. Reject bad bots. Unfortunately google doesn't publish ip addresses for googlebot…
Ali W
  • 287
  • 1
  • 4
  • 7
5
votes
1 answer

nginx reverse proxy not passing requests

I have a domain (example.com) and a subdomain (sub.example.com) both hosted on the same server. I want to proxy a request so any file requested on http://sub.example.com/api/ will be requested on http://example.com/api/ (along with the…
5
votes
4 answers

Nginx: Redirect both http and https root to subdirectory

I'm attempting to redirect the root domain for both http and https in nginx to the same subdirectory (https): So e.g. http://example.com -> https://example.com/subdirectory https://example.com -> https://example.com/subdirectory As simple as this…
Elijah Paul
  • 557
  • 1
  • 8
  • 19
5
votes
1 answer

Can I delete files in nginx client_body_temp directory?

On my nginx server, I can't login to my wordpress site. The error log mentions " No space left on device". 2014/09/26 02:02:05 [crit] 1197#0: *32 open() "/usr/local/nginx/client_body_temp/0030999742" failed (28: No space left on device) There is…
Adripants
  • 347
  • 2
  • 5
  • 16
5
votes
2 answers

Nginx/Apache: set HSTS only if X-Forwarded-Proto is https

I got the following setup: Internet => nginx[public:80 +443, SSL termination) => Varnish[localhost:81] => Apache[localhost:82] Now some sites should only be reachable via HTTPS and a valid SSL certificate. For these few exceptions I'd like to…
weeheavy
  • 4,089
  • 1
  • 28
  • 41
5
votes
2 answers

Serve a custom 404 page generated by PHP

Here is how my php-fpm config is: location @site { fastcgi_pass unix:/var/run/php5-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_intercept_errors on; error_page 404…
Matthieu Napoli
  • 421
  • 1
  • 5
  • 11
5
votes
3 answers

Nginx proxy based on SNI without decryption

I am currently using the following (simplified) configuration to proxy http and https connections over the same port (required by aws elastic beanstalk): server { listen 777 ssl; server_name foo.com; ssl_certificate…
user319862
  • 777
  • 2
  • 8
  • 20
5
votes
2 answers

How to properly configure nginx proxy pass when the endpoint is in a root context?

I'm trying to figure out how to configure a reverse proxy in nginx when the endpoint is in a root context: http://frontend.com/mylink proxy forwards to http://10.0.0.2:8000/ Unfortunately I can't change the context of the application at…
tftd
  • 1,498
  • 7
  • 25
  • 40
5
votes
1 answer

Nginx file upload pauses / stalls in the middle (uploads only 258kb and stops) - 408 request timeout

I have install bitnami nginx stack (nginx, php-fpm, mysql) to run multiple drupal 7 and node.js sites, but for now there is only one D7 site installed. File upload works perfectly in localhost. But as soon as I upload it to Linode vps with bitnami…
Amrit
  • 151
  • 3
5
votes
4 answers

Can't install nginx using epel repo on Centos 7 (64bit)

I've just built a 64 bit Centos server and I'm trying to install NGINX on it. Using the epel 7 (beta) repo I get the following error when trying to install: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base:…
Aditya K
  • 923
  • 3
  • 13
  • 24
5
votes
1 answer

firefox tries to open http subdomain as https [ nginx configuration ]

I have domain.com and sub.domain.com configuraed in nginx. domain.com has ssl certificate, while sub.domain.com has not. wherever I try to open http://sub.domain.com in any modern browser (firefox, chrome even in clean browser without plugins) it…
rush
  • 1,981
  • 2
  • 15
  • 23
5
votes
1 answer

What determines a practical limit on the number of server blocks in Nginx configuration?

I am trying to figure out if a Nginx configuration consisting solely of simple server blocks is feasible. Each block serves a subdomain, and directs the subdomain to another URL. Of course, the maximum in a specific context depends on the…
Sinan Ünür
  • 331
  • 4
  • 12
5
votes
2 answers

Reduce Gitlab memory footprint

I'm currently running both a Gitlab instance (v6.7.3) and a Ghost-powered personal blog on a DigitalOcean VPS with 512mb (lowest end), served by nginx. Until just recently I was unable to run both, because Gitlab failed to start, complaining about…
Alejandro Piad
  • 151
  • 1
  • 4
5
votes
1 answer

Nginx client request max time

I have an Nginx web server that will proxy to some other servers behind, and when I test a file upload request by exercising a cap on the upload speed to modem like speed, I managed to hold the upload connection for at least 15 minutes. Is it…
cbkihong
  • 51
  • 1
  • 2