Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
25 views

Convert this .htaccess to nginx

I am having some problems trying to translate this to nginx, today I can't make my brain to work well and solve this! RewriteEngine on RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*)$ $1 ...
85
votes
8answers
188k views

Make nginx to pass hostname of the upstream when reverseproxying

I run several docker containers with hostnames: web1.local web2.local web3.local Routing to these done based on hostname by nginx. I have a proxy in front of this setup (on different machine ...
0
votes
0answers
16 views

NGINX 502 Bad Gateway Connect() failed (133: No route to host) while connecting to up stream

Introduction Hello, I'm having an issue setting up Nginx for a test website. I have a host and a vm, on the vm a docker application is running on port 3000. Problem Now when I do 192.168.1.22:4444 (...
0
votes
1answer
14 views

Nginx Concurrent limit by per ip

How to limit concurrent http requests with nginx? Like "php -S localhost:8000" I tried but he responding status code to 503 (we need handle when other requests completed): limit_conn_zone $...
1
vote
1answer
1k views

Why is Perl Cgiwrap Sock refusing connection to nginx?

Could anyone shed some light on the following line in my nginx error logs. I'm trying to get Perl and Nginx talking to each other, but so far no success. unix:/var/run/nginx/cgiwrap-dispatch.sock ...
1
vote
2answers
2k views

Nginx, Varnish 4.1 Backend fetch failed

I can access the site via https and the admin section., but can't access non https/guest or anything that should be cached. varnishadm -S /etc/varnish/secret -T localhost:6082 debug.health ...
2
votes
1answer
1k views

Nginx proxy_pass error 500 on some files

new on this side of StackExchange. I've been trying to set up an nginx server to serve as a front http server that redirects to other servers within the network (later on to be used for load ...
0
votes
1answer
1k views

Apache / Nginx / Varnish - GZIP does not work on css, js

My current setup is as following: Apache -> Nginx -> Varnish running on Ubuntu apache2.conf: h**p://pastebin.com/A3wehAbe .htaccess: h**p://pastebin.com/Yre4hdSy (edited to allow deflate) nginx....
3
votes
2answers
3k views

Is it really possible to use PHP sessions for authentication with nginx fastcgi cache?

I have recently switched an opencart instance from Apache+mod_php to nginx+fastcgi+php-fpm. I have been trying to leverage caching for most pages through fastcgi-cache. Unfortunately, many users ...
1
vote
1answer
24 views

Owncloud behind Nginx (docker containers) not logging remote client IP

For some reason my Owncloud container behind an Nginx reverse proxy is not logging the remote client IP but the Nginx IP. Please check below my config files for Nginx. I've tried multiple solutions ...
0
votes
1answer
17 views

How to config Nginx to serve Angular app when the angular urls are like this http://serverpath/a/b?

I'm trying to serve an Angular(V7) app with Nginx. according to https://angular.io/guide/deployment#fallback-configuration-examples I change default Nginx config try_files $uri $uri/ =404; to ...
0
votes
0answers
12 views

GitLab installation has obscured all the other sites on Apache

I have Apache used also as a reverse proxy for a couple of web applications, both in HTTP and HTTPS, but after installing GitLab, it has obscured them all, and if I go to https://myapp.domain.com I'm ...
-1
votes
0answers
12 views

How to install and enable object cache for LEMP on ubuntu 18.04 [on hold]

I deployed my server on digital ocean with LEMP stack. I followed all the official article below to use my server:- https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-...
1
vote
1answer
947 views

Internal Rewrite in Nginx not work, and redirected

Hi I want a rewrite rule, but i don't want to redirect it, and requesting one URL but load different content from another URL. So, I think last and break flag in rewrite directive is a good solution. ...
0
votes
0answers
15 views

Reverse proxy for a 3rd party web app

I have a small home server that I use to run various web apps using Docker. I would like to be able to access each of these services on a unique path. This works fine for simple things (like a small ...
0
votes
1answer
11 views

Tomcat behind nginx proxy provides new jsessionids for each request

I have a ReactJS based web app being served by nginx on /. This web app contacts a web service running on Tomcat which is running on port 8443 on the same machine. I have set up a proxy_pass on nginx ...
0
votes
0answers
31 views

SSL handshake issue for part of users

I have a website that uses Nginx web server, It's work on both HTTP and HTTPS mode, but I'm wondering that HTTPS not working for some users while working for many users at the same time! Also, all ...
1
vote
2answers
1k views

tune up performance nginx php-fpm mysql

I am running a nginx+php-fpm+mysql on virtual server with 8 cores and 16G ram My aplication is a simple API provider server, which returns JSONs generated from mysql database on requests. Datasets are ...
2
votes
1answer
2k views

worker_connections are not enough while have idle workers

I try to increase number of concurrent connections my server can handle. $uname -a Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux $ulimit -Sn 65536 $ulimit ...
0
votes
0answers
18 views

nginx and host header with @ in hostname - wrong site served

I've setup a default server for my nginx, that should respond to all IP based requests, as well to all faked and whatever ones. This works, well almost always. Requesting a the site like the ...
1
vote
1answer
17 views

need to craft a regex matching a string in a url while excluding ending string

I'd appreciate some help with crafting the right regex for an nginx map block please. Essentially, I need a match a pattern [typically a word: such as course] in a url but url must not end in ...
0
votes
2answers
2k views

Nginx URI redirect (regular expressions)

I plan to rename one of my site's menu and I'll need to catch the old SEF urls and rewrite them to the new ones. One portion to change is in the middle of URL (old to new) and the other is at the end (...
78
votes
7answers
318k views

connect() failed (111: Connection refused) while connecting to upstream

I'm experiencing 502 Gateway errors when accessing a PHP file in a directory (http://example.com/dev/index.php). The logs simply says this: 2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed (...
0
votes
1answer
1k views

Nginx as a WebDAV server

I want to syncronise some of my applications across my server, because I do not really like to register on every service I use. I am using Nginx now, because I can do much-much more with that than ...
1
vote
2answers
2k views

uWSGI and NGINX 502: upstream prematurely closed connection

I have a Kubernetes cluster which is running Django application within docker container served by uWSGI. The ingress controller is ingress-nginx (this one: https://github.com/kubernetes/ingress-nginx)....
5
votes
2answers
4k 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 ...
1
vote
0answers
43 views

Win Server 2019 RDS HTML 5 web client not working behind nginx web proxy

Our environment requires that our Windows Server 2019 RDS Gateway (with the HTML 5 web client installed on it) be behind an nginx web proxy. The website portion of things work fine, but the connection ...
0
votes
2answers
273 views

Unable to implement Server Push

I am able to implement HTTP/2 on my Nginx server which resides within a Docker container. However, I am not able to carry out server push. These are the configuration files that I have written. /etc/...
0
votes
0answers
23 views

Uwsgi/nginx unix socket refusing connections

I have a python project that I am trying to serve with uWSGI and Nginx. I'm trying to connect the two with a Unix IPC socket (debian stretch), but the socket refuses connections whenever Nginx tries ...
0
votes
0answers
13 views

Chrome err_spdy_protocol_error and Firefox using spdy without according headers

On Chrome, when calling my webpage, I get a err_spdy_protocol_error page. Also, an nginx ssl handshake error is thrown. This got me thinking, why is Chrome using SPDY to call my page and why does it ...
0
votes
1answer
13 views

Nginx configuration for Geoserver

I'm trying to build a website with access to WMS services from a GeoServer instance on the same DigitalOcean droplet as the website. The droplet is an Ubuntu 18.04 server with - tomcat8 - postgresql-...
0
votes
0answers
17 views

Proxy requests to nginx from haproxy

I have haproxy in front of nginx, which simply serves static content. Direct access via nginx works perfectly fine - e.g., https://my-nginx-domain.com/some-sub-dir/image.jpg. Here's the nginx ...
0
votes
0answers
13 views

Passing PHP headers to NGinx Proxy

I have nginx setup as a proxy in front of APACHE, which in turn talks to PHP-FPM. It turns out, nginx is cutting out (or better to say not passing through) headers that are set directly in PHP via ...
1
vote
2answers
2k views

Nginx configuration issues

I'm having a lot of trouble getting my Nginx Website showing up correctly. I've been getting 404 errors, and now i'm getting a Connection Refused error. This is my Nginx configuration user www-data;...
1
vote
1answer
1k views

Ubuntu 12.04 open port 80 inside VLAN

I have an nginx server running on ubuntu 12.04 that serves http through port 80 and https through port 443. Everything works fine if I access it from the same computer via localhost, 127.0.0.1 or the ...
0
votes
0answers
16 views

Multiple values of limit_req_status for each nginx rate limiting zone

I'm testing nginx rate limiting example. The directive limit_req_status can return a custom error message for requests that exceed the zone's rate limit. I've defined 2 zones (limit1 & limit2). ...
0
votes
0answers
17 views

Encode query string in Nginx

I have Nginx in front of Gunicorn. But I'm getting request where some of the query parameters are un-encoded like this: &userUA=Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) ...
0
votes
1answer
1k views

NGINX configuration for video streaming server

I have purchased cloud server at digitalocean.com with 2GB RAM and DUAL CORE Processor. I want to set-up video proxy service i.e. to proxy youtube videos. I have installed NGINX + PHP-FPM server and ...
0
votes
1answer
33 views

What is the [::1] and 5353 here - resolver 127.0.0.1 [::1]:5353?

This page: http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver gives this example: resolver 127.0.0.1 [::1]:5353; What does the [::1] and :5353 mean?
0
votes
0answers
4 views

How to use Nginx reverse proxy to connect a public server to internal server? [duplicate]

I am currently working on a site that is hosted from a server running in my home. Here is the setup: Server running ESXi, two virtual machines First virtual machine is connected publicly to the ...
4
votes
0answers
616 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 ...
0
votes
0answers
17 views

Diagnosing increase in traffic hitting a Django web application

This question is about diagnosing the causes of elevated network traffic in an internet-facing web application. Background: The web application in question is a Django-based forum where users upload ...
0
votes
1answer
25 views

How I can use variables in nginx config to provide some paths for NGINX?

I want make dynamic subdomains with logs in separate directories, but have a problem with it: If I provide a path to logs like /var/www/demo/subdomains/$sub/logs/access.log and same with error, NGINX ...
1
vote
1answer
14 views

Using Nginx variables in place of CSP values

I have a fairly long Content-Security-Policy header value and I am having to place it in several location blocks. Is it possible to declare a variable in the configuration that has the value of my ...
0
votes
2answers
2k views

Jenkins behind nginx reverse proxy in subdirectory

I am struggling setting up Jenkins in a subdirectory behind nginx. There are 2 apps running on localhost. One of those is jenkins, which should be accessible by visiting foo.com/jenkins. The other app ...
0
votes
1answer
42 views

Can upgrading the timeout for my proxy pass in Nginx and Gunicorn cause any problems?

I'm going to add these configuration: proxy_connect_timeout 300s; proxy_read_timeout 300s; and for Gunicorn: gunicorn_django -D -b 127.0.0.1:8901 --workers=5 --pid=/var/webapp/campus.pid --settings=...
0
votes
1answer
1k views

Load testing nginx inside AWS

I'm trying to load test nginx running on AWS. I need to try to optimise it to handle 1Gbps of inbound traffic. Currently I've got it to peak at 85Mbit/s by running nginx on an m1.large with 4 other ...
0
votes
1answer
957 views

How can I force to cache requests that have “Cache-Control: no-cache” in nginx when using a reverse proxy and it responds with 404?

The upstream server is sending a 404 with a header of Cache-Control: no-cache. Due to this, nginx is not caching the request. How can I force it to cache the request? This caching is only required ...
4
votes
3answers
5k views

How to make an existing caching Nginx proxy use another proxy to bypass a firewall?

My question is about using Nginx as a proxy behind another proxy. (Somewhat confusing.) I want to set up Nginx so it acts as a caching proxy server to an npm mirror. Here is the link: http://eng....
-1
votes
1answer
20 views

Remote access to Nginx unavailable [on hold]

I have setup my first homelab/media server and am running Nginx as a reverse proxy with ssl listening to port 443. After I finished setting up nginx everything was functional and accessible both ...