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.

5,052 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
1answer
4k views

Use multiple password files for nginx

I have multiple server blocks in my config, all of them using the same file as auth_basic_user_file. Now we started to work with some external workforce, and we’d like to add some extra users to one ...
8
votes
3answers
6k views

Nginx reverse proxy in docker container - wrong IP logged

I am running Nginx in a Docker container as a reverse proxy using the configuration below. It basically redirects the request to another docker container running on the same machine Problem The ...
7
votes
1answer
3k views

Use of “sub_filter” in “IF” block under nginx config

I have nginx as reverse_proxy server for multiple applications running behind on various application servers. I want induce specific html/script into response content for set pre-registered urls. ...
7
votes
0answers
2k views

UWSGI SIGINT/SIGQUIT received

I'm trying to use nginx with uwsi. I wrote uwsgi ini file and test it with uwsgi --ini site.ini Everything works fine. But when I try to run the site I got the following error (from log file): *** ...
7
votes
1answer
2k views

nginx lua: os.execute waitpid() failed (10: No child processes)

So, I'm trying to execute a script on every request. I know how that sounds, this is for development environment. I've added this to my nginx config access_by_lua_file "/opt/nginx/git-magic.lua"; ...
7
votes
2answers
3k views

How do I pass headers from nginx X-Accel-Redirect back to the browser?

I'm using the nginx X-Accel-Redirect feature where a proxied backend (A) can "internally redirect" nginx to reprocess a new URI (B) as if that were the one originally given by the client browser. It ...
7
votes
2answers
3k views

Nginx HTTP2 IOS 11 not working

i have problems with HTTP2 protocol on my NGINX server, this is my configuration listen 443 ssl http2; server_name adomain.com; root /var/www/project; limit_req zone=one burst=60 nodelay; ...
6
votes
1answer
1k views

Nginx: Optimizing server response time for a HTTP cached website

I have a website with all of the pages served from nginx’s http cache and rarely invalidated or expired. The average total page download size is around 2 MB But despite being a static site with no ...
6
votes
0answers
215 views

How can one php-fpm 5.6 site cause an outage across all sites?

I have a real head scratcher with one site on a server affecting others in separate php-fpm pools. I thought the idea was that php-fpm pools gave isolation to stop (reduce) this from happening. We ...
6
votes
1answer
25k views

upstream prematurely closed connection while reading response header from upstream 502 Bad GateWay

nginx is killin me.. so right now I have 502 Bad Gateway. error log says: 2016/10/12 17:39:53 [info] 3023#0: *464 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0....
6
votes
1answer
885 views

Why isn't puma using all of its threads?

I'm using puma and nxinx, and as far as I can tell it is only ever using a single thread even when I start it with the default of 16 threads or more. I've set up a fresh rails app, then gone through ...
6
votes
1answer
3k views

How to debug CGI over fcgiwrap/nginx

I serve executable scripts (mainly in C) through fcgiwrap connected with nginx. Since the scripts are complied, I can get the coding errors during compilation, but sometimes I receive CGI errors ...
6
votes
5answers
4k views

Creating a fallback error page for nginx when root directory does not exist

I have set up an any-domain config on my nginx server - to reduce the amount of work needed when I open a new site/domain. This config allows me to simply create a folder in /usr/share/nginx/sites/ ...
6
votes
1answer
4k views

nginx regex characters that require quoting?

So I was configuring nginx today and I hit a weird problem. I was trying to match a location like this: location ~ ^/([0-9]+)/(.*) { # do proxy redirects } ...for URLs like "http://my.domain.com/...
5
votes
0answers
5k views

nginx proxy_pass one file

I have a single file that I want to appear to host but that I don't. So I write this in my nginx server block: location /d-p27.js { proxy_pass https://data.example.com/p/piwik.js; } After ...
5
votes
1answer
701 views

Is it possible to disable clients not supporting SNI in nginx?

By default nginx serves https requests with multiple certificates by using SNI. The fallback for clients not supporting SNI will be the default_server or first vhost which has been configured. I want ...
5
votes
1answer
1k views

Nginx does not update max-age

If I make a request to a Nginx-proxy server configured to cache an upstream I get the following response headers: {'content-length': '13200000', 'x-cache-status': 'MISS', 'server': 'nginx/1.9.9', '...
5
votes
2answers
4k views

nginx deny ip - access forbidden by rule in error log

We having blocked some bad bots which relentlessly try to access our site via "Deny" directives in NGINX. It's not possible for us to block it at the firewall, as we use a load balancer that we have ...
5
votes
2answers
1k views

Checking HTTPS setup on Apache/Nginx before using

You have just got a new HTTPS (SSL/TLS) Certificate, and what you hope is the correct Intermediate Certificates. This is setup in Apache with: SSLCertificateKeyFile /etc/ssl/www.example.com.key ...
5
votes
1answer
2k views

Nginx reverse proxy with dynamic port forwarding

I'm setting up a reverse proxy on Nginx. I need it to listen to multiple ports. I then would like to hit the exact same port on the backend server. Like this: http://frontendserver:9000 -> http://...
5
votes
1answer
1k views

Forward Kerberos Authentication on Ansible

I have an ansible control machine (host-A) that need to talk with host-C, an Windows machine that doesn't have local users (It's an Active Directory). host-A doesn't have network access to host-C, ...
5
votes
1answer
5k views

NGINX does not prompt for client ssl certificate

On our setup we want to promt a user for a client ssl certificate. All certificates are issued by StartSSL. The problem is that even though ssl_verify_client on; is set 'on', the website / browser ...
5
votes
1answer
2k views

NGINX Unicorn 504 Gateway Time-out

I try all what I found in the Google by this question, but - nothing. It doesn't work anyway. My NGINX default: upstream app { server unix:/tmp/unicorn.rails.sock fail_timeout=0; } server { ...
5
votes
0answers
3k views

Unable to apt-get install nginx-extras package on top of nginx 1.7.9

I am attempting to install Phusion Passenger for nginx on a dev Ubuntu box following this guide from the passenger website. I have Nginx installed and running already, version is 1.7.9-1~trusty. I ...
5
votes
1answer
3k views

Unicorn workers timing out intermittently

I'm getting intermittent timeouts from unicorn workers for seemingly no reason, and I'd like some help to debug the actual problem. It's worse because it works about 10 - 20 requests then 1 will ...
5
votes
1answer
4k views

nginx & php-fpm [debug] 11: Resource temporarily unavailable

New Development The core php error logs are below, but the site specific error logs show this. The memory on my php.ini file is : memory_size 1024; so it's not php's memory limit. I've also ...
5
votes
0answers
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 ...
5
votes
0answers
2k views

Nginx returning 408 error with XHR2 file uploads during mid-upload

A customer of mine is trying to upload a file to our remote nginx webserver via a form POST using XHR2 form data (and a cross-domain request with CORS). During mid-upload, the webserver returns a 408 ...
5
votes
1answer
2k views

Using nginx: require authentication when request from public IP, not needed when local

I wrote a simple file browser app which is served using node on port 3000. I use nginx as a front-end which proxies this service. This is on my home server. I would like to be able to require basic ...
5
votes
0answers
2k views

nginx sticky sessions / ip_hash with Socket.io

I am to be load balancing two node.js/Socket.io instances on different boxes with nginx running a simple notifications service with a retroactive event for new clients. I don't think there will be ...
5
votes
2answers
5k views

Optimize php-fpm and varnish for a powerful server

My setup is Intel® Core™ i7-2600 and RAM 16 GB DDR3 RAM varnish+nginx+php-fpm+apc for a not very heavy WordPress blog with W3 Total Cache and CDN My problem is that after 55 hits per second ...
5
votes
2answers
3k views

Nginx Multiple Domains

I am trying to add a second virtual host to nginx. When i go to the new domain it redirects to the old one. I have tried restarting Nginx, rebooting the server. Has anyone come across this before, ...
5
votes
2answers
6k views

Nginx + PHP-FPM Timeouts, almost zero load consumption?

I've got a server running on a Linode with Ubuntu 10.04 LTS, Nginx 0.7.65, MySQL 5.1.41 and PHP 5.3.2 with PHP-FPM. There is a WordPress blog on it, updated to WordPress 3.2.1 recently. I have made ...
4
votes
0answers
514 views

NGINX auth_request and 302 response status = 500 invalid URL prefix

I'm trying to make NGINX authenticate requests with OAuth2 server (authorization code flow) that will redirect client to the login page. Is it possible to use auth_request directive for that? Here is ...
4
votes
0answers
104 views

accessing nginx server not from all hosts possible

I have the following problem that not all my PCs can access the kcam7.local where a nginx server (port 8080) is running. First of all here is the network configuration: So, it is no problem to access ...
4
votes
1answer
509 views

How to make Certbot ignore a particular domain in nginx?

I have ~30 domains running on my server, all of them with SSL certificates managed by the Certbot nginx plugin. All of them, except one... let's call it selfsigned.example.com. This domain uses a ...
4
votes
0answers
2k views

Nginx, PM2, Node - No 'Access-Control-Allow- Origin' header

I have developed NodeJS server ran with express. I use PM2 to manage the application and then nginx to proxy requests to the application. My Express application has CORS, CSP etc set up. But, the ...
4
votes
0answers
438 views

Copy nginx cache between two servers

I have a nginx caching server with at least 2tb of cache files at any moment, i need to migrate this server to another hosting provider but none of my clients can handle that traffic without cache. ...
4
votes
0answers
661 views

NGINX-RTMP Load Test

I use Roman Arutyunyan's NGINX-RTMP module with RTMP as input and HLS as the output. How can I load test it? I want to know how much load the server can handle both from simultaneous streaming and ...
4
votes
0answers
375 views

REQUEST CACHING IN NGINX

I am trying to cache my requests in nginx. I have connected my django server as upstream. Now, I am trying to cache my requests. proxy_cache_path /var/cache/nginx/ keys_zone=one:10m; location / { ...
4
votes
0answers
2k views

`nginx reload` and `nginx -t` very slow - how to investigate

I have a quite small VPS on AWS (EC2 t2.nano) that is running an nginx server. while sometimes a sudo service nginx reload or nginx -t is blazing fast, most of the time it is horribly slow (>60 ...
4
votes
2answers
192 views

SSL on both ELB and server

I configured my ELB to be able to serve ssl pages by putting my certs in the ELB itself. Say the ELB serve requests from www.example.com. At the same time i need to use ssl outside the ELB and serve ...
4
votes
0answers
2k views

laravel app cannot detect https schema behind reverse proxy

I've a following config: <client> <ssl nginx> <80 nginx> <laravel> laravel has a method called asset() which is supposed to detect schema and output correct url. But it doesn'...
4
votes
0answers
1k views

500 internal error when setting up reverse proxy for Wikipedia

Access to Wikipedia can be disturbed randomly in my country Running Debian 7 with nginx 1.2.1 with additional ngx_http_substitutions_filter_module use several sub-domains to reverse proxy ...
4
votes
0answers
2k views

How do I convert Nginx location rewrites to Apache

I have a site that was running using nginx but now it is apache Im trying to convert nginx to apache and have had no success This is the nginx file I want to convert to apache: server { listen ...
4
votes
5answers
5k views

Rewrite rule for nginx (Opencart)

Opencart has this URL structure: http://example.com/index.php?route=common/home http://example.com/index.php?route=account/register http://example.com/index.php?route=checkout/cart http://example.com/...
4
votes
1answer
3k views

How to create subdomains using nginx and proxy_pass for each

I currently have nginx setup for my server at my.server.com. Using the current configuration I access different applications using http://my.server.com/app1 or http://my.server.com/app2. I have an ...
4
votes
1answer
2k views

exclude IP from nginx access log

How to exclude some IP address from access log? This is my config: server { listen 443 ssl; [...] access_log /var/www/web/log/access.log; error_log /var/www/web/log/error.log; location / { ...
4
votes
0answers
897 views

HAproxy and nginx RTMP

I am trying to use HAproxy in front of an RTMP nginx server. It does connect but it does not play the video. I have 2 servers: one with nginx using RTMP and another one with HAproxy. This is the ...
4
votes
0answers
949 views

client_body_buffer_size threats

in my current nginx configuration I got: client_max_body_size 100M; client_body_buffer_size 1M; client_max_body_size I need to be set so big. Unlucky I often got notices when ppl ...

1
2 3 4 5
102