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.

Filter by
Sorted by
Tagged with
6 votes
2 answers
17k views

nginx with php-fpm downloading php files rather than executing them on mac os x (local environment)

I'm having trouble getting PHP files to execute on my local development machine. I seem to have successfully installed nginx and php-fpm also seems to be correctly installed, and running but can't ...
Oliver Tappin's user avatar
6 votes
2 answers
14k views

Server has apache installed. How to install nginx alongside it?

Apache is installed and is used to serve mostly Django/Python content. I want to install nginx to serve static content. How to do it and what is a good configuration. I am on Ubuntu and Apache was ...
shabda's user avatar
  • 300
6 votes
1 answer
3k views

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 ...
Sinan Ünür's user avatar
6 votes
2 answers
4k views

How soon does nginx's token bucket replenish when limiting at requests per minute?

We've decided that we want to experiment and limit requests per minute instead of requests per second on our sites. However, I am confused by the burst parameter in this context. I am under the ...
Michael Gorsuch's user avatar
6 votes
1 answer
19k views

Overriding nginx deny rule for a single location block

I have an nginx setup like this, where a server should be mostly private (only certain IP address may use the server), except for one location block which should be publicly available: server { ...
Christopher's user avatar
5 votes
2 answers
1k views

What's the best server to use with ASP.Net on Mono? [closed]

I am reconfiguring my website from scratch and basically I want it to run Mono(well, ASP.Net inside Mono) According to the Mono Project there appears to be two options, Apache or Nginx. Which one ...
Earlz's user avatar
  • 1,039
5 votes
3 answers
7k views

Redirect http://example.com:12345 to https://example.com:12345 in nginx

I know this must have been answered already, but I have been searching for quite a while, and cannot find the answer. Just not looking in the right place I guess, maybe someone can help me out. ...
Saif Bechan's user avatar
5 votes
3 answers
10k views

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 ...
user319862's user avatar
5 votes
3 answers
16k views

Ignore nginx server error_page config for for one specific location directive

I have static error pages set up for my server, but I want to ignore those for urls starting with /api/ so the handler there can respond with a non-200 code, but not return the static error page. ...
Ben Burleson's user avatar
5 votes
2 answers
28k views

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 ...
MultiformeIngegno's user avatar
5 votes
1 answer
7k views

Why doesn't nginx like my $args?

I have a WordPress site located at mysite.com/blog, the files of which are located in /var/www/mysite/wordpress. Why, when I visit mysite.com/blog/test, does my nested location block only get hit if I ...
Jonathan's user avatar
  • 1,329
5 votes
0 answers
2k views

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 ...
Titi's user avatar
  • 240
5 votes
1 answer
6k views

nginx ssl certificate issue key values mismatch

I am have been trying to setup an ssl certificate for a few days now, I am buying it from Namecheap.com and I am buying a rapid ssl wildcard certificate I am doing the following: Generate a csr - ...
Oliver Bayes-Shelton's user avatar
5 votes
1 answer
4k views

Override $scheme in nginx When Behind Load Balancer

I've got an nginx server sitting behind a load balancer. The load balancer handles SSL termination with all requests hitting nginx on port 80. I'm also using the SRCache module for full page caching ...
kingkool68's user avatar
5 votes
1 answer
18k views

nginx reverse proxy slows down my throughput by half

I'm currently using nginx to proxy back to gunicorn with 8 workers. I'm using an amazon extra large instance with 4 virtual cores. When I connect to gunicorn directly I get about 10K requests/sec. ...
Isaac A Mosquera's user avatar
5 votes
1 answer
6k views

Mixed IP and Name Based Virtual Hosts with nginx

I set up many domains but I dont know how to configure if only ip address is given. say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to web/fook....
nerkn's user avatar
  • 195
5 votes
2 answers
17k views

How can I use wildcards in an Nginx map directive?

I am trying to use Nginx to served cached files produced by a web application, and have spotted a potential problem; that the url-space is wide, and will exceed the Ext3 limit of 32000 subdirectories. ...
Ian Clelland's user avatar
5 votes
3 answers
10k views

Howto Nginx + git-http-backend + fcgiwrap (Debian Squeeze)

I am trying to setup git-http-backend with Nginx but after 24 hours wasting time and reading everything I could I think this config should work but doesn't. server { listen 80; server_name ...
brainsqueezer's user avatar
5 votes
2 answers
1k views

nginx clobbering sftp traffic during peak times - is tc the answer?

This is probably a continuation of my previous (unanswered) question because the underlying cause is probably the same. I have a Linux server with nginx and sshd running on it. It's on a shared ...
njahnke's user avatar
  • 290
5 votes
3 answers
23k views

How to configure nginx to redirect all request from domain aliases to main domain?

I do have an nginx server which responds to several domains and I do want to redirect all request to the main domain. Example: website responding for xxx xxx.example.com yyy.example.com $hostname for ...
sorin's user avatar
  • 8,236
5 votes
1 answer
14k views

Disable deflate compression in nginx SSL

When I'm browsing to my SSL protected site running nginx with Chrome, I see I'm using TLS 1.0, AES_256_CBC with SHA-1, and DHE_RSA as key exchange. That's all good and in conformance with my cipher ...
hvtilborg's user avatar
  • 217
5 votes
1 answer
3k views

Why is the ssl session cache ( ssl_session_cache) disabled by default in nginx?

In nginx, the ssl_session_cache directive has a default of 'none'. ref However, in the documentation for configuring HTTPS server, it's advised to turn on the ssl session cache, as it explains that ...
CausingUnderflowsEverywhere's user avatar
5 votes
4 answers
17k views

Forcing a particular SSL protocol for an nginx proxying server

I am developing an application against a remote https web service. While developing I need to proxy requests from my local development server (running nginx on ubuntu) to the remote https web server. ...
vitch's user avatar
  • 640
5 votes
1 answer
8k views

How to get substring of a string with nginx

Say I have a value taken from cookie with $cookie_MY_COOKIE which contains 64 characters. How can I remove first 60 characters in nginx configuration?
Duong Nguyen's user avatar
5 votes
2 answers
25k views

Docker based reverse proxy with NginX for multiple domains

I'm trying to create a docker based multi-container setup with a reverse proxy for multiple domains to serve, where the websites, the databases and the nginx based reverse proxy run in containers, but ...
elaspog's user avatar
  • 253
5 votes
3 answers
10k views

gzip not working on nginx

conf gzip on; gzip_vary on; gzip_min_length 100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/javascript application/json application/javascript;
clarkk's user avatar
  • 2,085
5 votes
1 answer
26k views

Nginx 404 for css js files

I can't load css and js files on my MAC. I get 404 for those files. on Ubuntu in nginx.conf I just add on the end rewrite ^/assets/([a-z\-]+)-([a-z0-9]+).(css|js) /assets/$1.$3; and it works. But I ...
RobDee's user avatar
  • 155
5 votes
1 answer
5k views

Using ab to benchmark nginx: Connection reset by peer (54)

I recently updated to nginx 1.0.8 and tried to benchmark performance for cached dynamic pages (initially served by a Django app via proxy_pass) and for static pages. In both cases, nginx will not ...
janeden's user avatar
  • 267
5 votes
2 answers
4k views

How to tell nginx to serve https only for one vhost-managed domain?

I have an ec2 instance running ubuntu and nginx 0.8.4, with vhosts serving several different domains using http but one using SSL/https. Secure domain configuration: server { listen 443 ssl; ...
NiKo's user avatar
  • 153
5 votes
1 answer
10k views

gzip compression doesn't work in nginx reverse proxy setup

We have nginx in front of an Apache server in reverse proxy mode. We initially had Apache compressing files using mod_deflate, however that proved to cause problems with some instances of Internet ...
Oz Solomon's user avatar
5 votes
2 answers
5k views

return error 410 for location regex? in nginx

I'm using nginx-1.6.2,2 and I'd like return error 410 for URL that matches /browse.php?u=http, so requests such as this will get 410: 162.218.208.16 - - [21/Nov/2014:12:35:40 -0500] "GET /browse.php?...
alexus's user avatar
  • 13.4k
5 votes
5 answers
5k views

Nginx vs Lighttpd for WordPress server performance?

Which web server would be more suitable for running a few instances of wordpress? They are both pretty easy to setup, so I am wondering mostly about performance. Would there be a difference? I think ...
verhogen's user avatar
  • 333
5 votes
3 answers
6k views

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 ...
Howard's user avatar
  • 2,175
5 votes
2 answers
27k views

Restart webserver without entering a password? [duplicate]

Possible Duplicate: stop apache from asking for SSL password each restart When I created my SSL certificate I used a pass phrase in the key. Whenever I restart my web server (Apache or Nginx) ...
Tom's user avatar
  • 4,367
5 votes
3 answers
6k views

nginx: redirect subfolder to subdomain

I'm trying to redirect a subfolder to a subdomain in nginx. I want http://example.com/~meow/ to be redirected to http://meow.example.com/. I tried the following: location ~ ^/\~meow/(.*)$ { ...
mrm8's user avatar
  • 65
5 votes
2 answers
24k views

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 ...
Rob's user avatar
  • 2,453
5 votes
5 answers
41k views

How to proxy requests to an internal server using nginx?

I have setup a web server to view my repositories (a Gitalist instance) on http://localhost:3000 and I want to setup a proxy using nginx. I want that the request is proxied to my repository view when ...
eliocs's user avatar
  • 197
5 votes
2 answers
5k views

Recompile NGINX with "--with-http_stub_status_module" configure line

I've installed NGINX with sudo apt-get install nginx and now I'd like to recompile it with the configure option --with-http_stub_status_module. How can I do this, and is there a way I can not loose ...
tarnfeld's user avatar
  • 471
5 votes
5 answers
4k views

Which Is a Good Starting Point For Beginner? Apache, Nginx or Cherokee?

Any of these web server software i.e., Apache, Nginx and Cherokee is suitable for my website at the moment. And I am learning sysadmin to be able to manage my server (and not for a job). For a ...
user avatar
5 votes
2 answers
10k views

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 ...
Kevin Herrera's user avatar
5 votes
2 answers
33k views

Multiple versions of PHP through nginx

EDIT: For future reference Multiple versions of PHP through nginx Nginx and different versions of PHP FPM + PHP I am running Ubuntu 14.10 with a LEMP stack using PHP 5.5.12. I have a number of ...
myol's user avatar
  • 181
5 votes
2 answers
4k views

Nginx 1.6.3 to 1.8 upgrade

I'm on Linux Mint LMDE. I just receive a upgrade of nginx from 1.6.3 to 1.8.0 with aptitude and now, I got blank page on all my websites Here my configuration : server { listen 80; ...
Bouffe's user avatar
  • 293
5 votes
1 answer
2k views

How do I DRY up this Nginx configuration?

I’m on Nginx 0.8.54 trying to achieve the following as DRYly as possible: Proxy straight to localhost:8060 if cookie no_cache is true or if request method isn’t GET. Otherwise serve static files from ...
freya's user avatar
  • 153
5 votes
2 answers
14k views

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 ...
F21's user avatar
  • 716
5 votes
2 answers
5k views

Can HAProxy select a backend based on a lookup table?

Let's say I have items A, B, and C. I have two backend servers: server01 and server02. Item A can be handled by server01, item B and C can be handled by server02. New items and servers get added and ...
kvz's user avatar
  • 402
4 votes
1 answer
5k views

Is there a clean way of combining nginx location rules?

Suppose that in my nginx server I want to accomplish these two requirements: 1) all *.php files are to be passed to the php interpreter 2) directory /private/ should require http authentication ...
leonbloy's user avatar
  • 2,148
4 votes
2 answers
2k views

Nginx Make website inaccessible via IP

I've got my website set up to be accessible via example.com. If possible I want to prevent it from being accessed via its IP altogether or at least 301 redirect it to website. Is the former possible ...
Hedge's user avatar
  • 163
4 votes
1 answer
2k views

Exclude a specific query parameter from being logged in Nginx?

I wonder if it's possible to exclude specific query parameters in the URI from being logged to the Nginx access log? Here's our current configuration: log_format main '$remote_addr - $remote_user [$...
Johan's user avatar
  • 237
4 votes
3 answers
1k views

fail2ban bans IP addresses, yet they still appear in access.log

This is my filter: [Definition] failregex = <HOST> .* "POST /customer/account/create.*$ <HOST> .* "GET /customer/account/create.*$ and this the corresponding jail: [...
digijay's user avatar
  • 1,225
4 votes
1 answer
1k views

auth_request doesn't block return directive, can't return status?

A trivial scenario. We had the following location declared to test if the server is reachable: location = /ping { return 204; } We have decided that we want to protect it with the same ...
msanford's user avatar
  • 1,487

1
10 11
12
13 14
22