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.
17,208
questions
1
vote
1
answer
8k
views
How to set nginx reverse proxy to an SSL site without certificate?
There is a function using TCP pass through like this:
stream {
upstream web_server {
# the site to be visited is https://whatismyip.com, below is its real address
server 104.27.194....
1
vote
1
answer
7k
views
Nginx with multiple domains/subdomains and ssl_certificate variable
We have a Nginx with hundred of proxies to several domains/subdomains.
The way it being held during years, each new domain, we just go there and create a new conf file with server block containing ...
1
vote
1
answer
12k
views
Nginx what is the right configuration for Socket.io?
If I have a node express server running on port 5003
import express from 'express'
import { createServer } from 'http'
import { Server } from 'socket.io'
const app = express()
const prod = process....
1
vote
1
answer
1k
views
Installing Matomo on Nginx returns 502 Bad Gateway Error
I'm in the process of installing the Matomo Analytics platform on my Debian 10 server, running Nginx and using the Cloudflare DNS and CDN. Unfortunately I get a 502 Bad Gateway error when trying to ...
1
vote
1
answer
5k
views
On synology dsm, add a specific nginx config to a specific virtual host
On a synology dsm we use an nginx webstation. On this webstation we have (several) virtual hosts. One example is that we wish to redirect all incoming traffic on port "282" (which is beyond ...
1
vote
1
answer
1k
views
nginx: disable open_file_cache for specific file
we are using nginx with file cache on:
http {
open_file_cache max=10000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 4;
open_file_cache_errors ...
1
vote
1
answer
2k
views
How to choose EC2 instance type for reverse proxy (4 million requests / month)
First time i have to create a reverse proxy on AWS, and i do not know with kind of instance to choose.
I plan to create an EC2 to load balance my traffic between a main website (/) and a wordpress ...
1
vote
1
answer
3k
views
check that a DNS record exists for this domain
I have the following ingress manifest file:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: fsm
name: fsm
labels:
app: fsm
annotations:
kubernetes.io/ingress.class: ...
1
vote
1
answer
607
views
Is it possible to use a auth_basic password protection using linux users and passwords?
I'd like to password protect a website allowing only Linux users and their passwords stored in /etc/passwd and /etc/shaddow to login.
Apache and nginx allow to restrict accessung by using a HTTP ...
1
vote
1
answer
2k
views
Nginx removes post data with content-type header
I am making posts like this:
curl 'http://localhost/api.php' -H 'Content-Type: application/json' --data 'names=[{"name":"name"}]'
Which results in the post data being deleted.
If ...
1
vote
1
answer
5k
views
In Nginx why might 405 error page display properly in the main server block but not in server blocks that redirect to the main block?
I use two server blocks to forward all requests to a main block that serves all requests with a https://www prefix. When I throw a 405 error with https://www in the request the corresponding error ...
1
vote
1
answer
12k
views
How do I properly configure SSL on the backend between nginx and an app?
I am trying to configure re-encryption on a backend, so that traffic between nginx and the upstream app is encrypted separately from traffic between the user and nginx. For the purpose of a test ...
1
vote
1
answer
549
views
Can nginx proxy_cache replace fastcgi_cache?
If nginx is already used with proxy_cache, is there still any need to use fastcgi_cache?
In other words.. When using nginx proxy_cache, there is no more need for fastcgi_cache?
1
vote
1
answer
10k
views
ingress nginx upstream sent no valid HTTP/1.0 header while reading response header from upstream
I'm trying to setup an nginx ingress controller for services in my namespace.
One of the backend services accept HTTP traffic on port 80, the other accepts only HTTPS traffic on port 443. See the ...
1
vote
1
answer
357
views
Kubernetes - Ingress vs Nginx with Loadbalancer
AFAIK an Ingress is just an abstraction layer to a LoadBalancer service targeting Nginx (or others)
Are there features only an ingress can provide? Are there any drawbacks of using LoadBalancer + ...
1
vote
2
answers
1k
views
How to remove last request parameter of the URL from Nginx
I am new to Nginx, I am having one request URL coming with Token request parameter along with some other request pram. I just want to remove that Token parameter from the URL if its present.
below ...
1
vote
1
answer
1k
views
Is there any risk to change www-data to root in Nginx.conf?
I have encountered a permission error serving my files so I changed the
user www-data;
to
user root;
in the nginx.conf file.
Is there any risk to do so?
1
vote
1
answer
51
views
Is it possible to have many domains on the same server with as many certificates?
In my nginx configuration website.conf I would like to have something like this:
server {
listen 443;
server_name firstdomain.com seconddomain.com;
...
ssl_certificate /etc/...
1
vote
1
answer
7k
views
Redirect all POST / GET requests on nginx server to another domain
My goal is to redirect all API requests (both GET or POST) from old-domain.com to new-domain.com but only from specific GET company_id value (ABC). We will still treat other requests other than that ...
1
vote
1
answer
3k
views
Nginx allow only specific API paths
I am very new to Nginx and I have below configuration in Nginx
server {
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000;
...
1
vote
2
answers
6k
views
Nextcloud behind Ngnix reverse proxy in a subdir url
I use a Ngnix reverse proxy to keep several docker services behind HTTPS and in the same DNS.
Basically I want to access to Nextcloud with: https://server.<my-dns>.fr/cloud/
I have access to ...
1
vote
1
answer
5k
views
nginx filtering headers with a dot in the header name, even after enabling ignore_invalid_headers
A client (developed by a third party) is sending a request with headers like foo.meta-digest (note the "dot" in the header name).
My nginx reverse proxy is removing these headers from the request even ...
1
vote
1
answer
2k
views
Force redirect to https on specific port on nginx?
I have website on port 8080 and I want to force https on it.
ex.
If I type http://mywebsite.com:8080, it should redirect to https://mywebsite.com:8080
How can I do this in nginx conf?
1
vote
1
answer
4k
views
Serving WEBP with nginx conditionally for Laravel
I'm not able to serve jpeg or png images to webp on my Ubuntu server.
The request:
Request URL: https://staging.myserver.com/images/mainfoto.jpg
Request Method: GET
And the response is:
accept-...
1
vote
1
answer
242
views
Nginx, where does the host name in this error come from?
I have a server setup with the name 'api.mydomain.com'. I have an error being generated by the application, and the error text is being appropriately logged as:
[error] 9#9: *6916 FastCGI sent in ...
1
vote
1
answer
14k
views
Setting noindex some pages on NGINX
I want to set noindex some URLs. If any URL contains ?lang= | (start with) /plugin | (start with) /account it should be noindex by adding HTTP header in NGINX configuration.
I tried below code before,...
1
vote
2
answers
26k
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 (...
1
vote
1
answer
1k
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 ...
1
vote
1
answer
11k
views
How to deploy a WSGI/Python app behind Nginx on Windows?
Coming from the Linux environment, I'll try to be as accurate as possible with Windows concepts I clearly don't master.
Here's my current situation:
I have a functional Windows (10 pro x64) Nginx ...
1
vote
2
answers
2k
views
Line breaks in PHP's stack trace in nginx error logs disturbing logstash analysis
I am using nginx with PHP-FPM and ELK as log file analysis.
When a PHP script causes an error the interpreter the error will be send back to nginx and nginx puts the error into the error.log file.
...
1
vote
1
answer
5k
views
Nginx proxy cache 404 not found static files (css,js,jpg,png vb)
My Nginx Proxy Server : 10.90.100.2
My Backend Server : 10.90.100.3
my proxy server not loading static files (css,js,woff,png vb.)
My conf
proxy_cache_path /etc/nginx/proxy_cache levels=1:2 ...
1
vote
2
answers
2k
views
nginx fails to send HSTS headers despite being configured to do so
I'm setting up a site for myself using nginx and letsencrypt, and I wanted to set up HSTS preloading for the added security benefits, however when I check the url with multiple different scanners, ...
1
vote
1
answer
31k
views
How to configure multiple servers on the same IP address with Nginx? [duplicate]
I'm starting with Nginx.
I installed on my server:
1 Drupal site on www.example.com
1 GoAccess site on analytics.example.com
1 Netdata site on monitoring.example.com
The IP address and example.com ...
1
vote
1
answer
1k
views
Nginx not logging $remote_port when coming from cloudflare
We offen receive requests from police to provide the ip and port of visitors.
When the requests come via cloudflare(https), the $remote_port variable is empty, when I access the load balancer via it'...
1
vote
1
answer
224
views
NGINX proxy_pass setup fails when adding a location for expiring file types
When adding the following to my Nginx config server block, the /blog/ location starts 404'ing all file types referenced. What is the correct way to leverage the expires directive and continue to keep ...
1
vote
1
answer
1k
views
Nginx Too many open files although not close to limit
The error log is filled w/ Too many open files.
I increased the ulimit and fs.file-max to very high numbers (and validated the change via sysctl -a | grep fs.file-max and ulimit -n on the nginx's user)...
1
vote
2
answers
4k
views
Ubuntu 18.04.1 hangs regularly
I have some Ubuntu 18.04.1 virtual machines installed on VMWare ESXi 6.5, all of them have 3 core, 3GB ram, attached to a SAS Storage array.
The servers are running nginx 1.14.0 as reverse proxy for ...
1
vote
1
answer
2k
views
nginx - redirect based on port number
I want to use nginx as a load balancer to distribute load over 2 servers. I have done this in the past, but am stuck with a specific requirement.
I need to forward the requests onto the servers (from ...
1
vote
1
answer
2k
views
Nginx not compressing tff files
I have added this to my nginx config
gzip_types application/javascript application/font-ttf text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss ...
1
vote
1
answer
3k
views
Nextcloud 14 does not upload files bigger than 1MB
I am running Nextcloud 14 on Debian Stretch with nginx, php-fpm7.2, mariadb and redis inside a LXC container (Proxmox VE, lvm thin storage). On another LXC container, alpine linux 3.8 runs an nginx ...
1
vote
2
answers
4k
views
nginx reverse proxy for high availability setup?
The scenario is like this, I have a nginx reverse proxy server in front of two app servers which are backups of each other, I want nginx to forward all user requests to the first app server at first, ...
1
vote
1
answer
6k
views
Nginx subdirectory try_files wildcard always fail
Nginx 1.10.3 Ubuntu, standard apt installation. index index.php; located outside server block.
I need:
http://example.com/test/1 pointing to
/var/www/example.com/test/1
http://example.com/test/2 ...
1
vote
1
answer
5k
views
nginx rewrite if query string exists
In the past a project was getting moved from / to /subdir. As the old URL structure was something like /index.php?foo/123/bar I used the following rewrite to get everything to /forum:
rewrite ^\/...
1
vote
2
answers
2k
views
GitLab behind nginx doesn't work
My GitLab is running on port 9999 and it can be accessed using the below URL
http://server01.example.com:9999/ (which redirects to http://server01.example.com:9999/users/sign_in)
or it can be ...
1
vote
1
answer
2k
views
nginx multiple default blocks on different ports with redirects
I currently have two nginx server blocks to process the requests to any subdomain under example.com. Add subdomains under example.com must be server only with HTTPS. And so the server blocks are as ...
1
vote
2
answers
1k
views
Nginx proxy_set_header base on verb
I have a buggy client which sends a bad Content-Type header when POSTing to a specific url. The API in question already sits behind an nginx 1.15 reverse proxy, so as a workaround until those clients ...
1
vote
1
answer
4k
views
Nginx tries to run on port 80 but the configs have been removed
I have a server that runs nginx with varnish.
I cannot run nginx and varnish at the same time as the they are both trying to listen on port 80.
nginx is configured to listen on port 8080
...
1
vote
1
answer
812
views
nginx vhost site priority
I heed some help figuring out why my nginx is prioritising the site this way. I have server blocks in my vhost:
server { #site 1
listen 80;
server_name site1.testing.domain.com$;
root /...
1
vote
1
answer
2k
views
Nginx to Tomcat SSL proxy
I have configured a tomcat application with SSL for client authentication purpose. It is on port 8443. It works fine so that when I try to hit tomcat with client certificate(client.p12) I got success ...
1
vote
1
answer
180
views
Network performance with an i7 6700 Skylake
We're looking into setting up multiple servers with Nginx; the estimated required capacity is 60 Gbps (six-zero gigabit per second)
A nearby datacenter offers us servers with "i7-6700 Quad-Core ...