Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
2 views

Configure Nginx to search for specific files in another directory

When trying to get Nginx to use a certain directory for css files, I cannot seem to get the path to resolve: I keep getting a 404. server { listen 443 ssl; server_name localhost; ...
0
votes
0answers
9 views

Can I point a sub-folder to a different server using nginx?

I have a very old server that has a legacy application on it that powers a website. I can't really modify much on this server as it is very old, I am slowly migrating away from it before I ...
0
votes
0answers
7 views

What is expected memory usage for each Phusion Passenger process

My server sometimes runs out of memory and ends up killing MySql The setup is: Single Ruby on Rails app running in production on a MySql database with no more than two or three requests per second ...
3
votes
1answer
67 views

NGINX SSL does not respond over IPv6

On a Debian server with nginx, I get no response from a web server over HTTPS and IPv6. HTTP works fine. netstat reports port 443 listening on IPv6 address firewall is opened, ipv6scanner.com ...
0
votes
0answers
16 views

Is there any way to redirect access if proxy cache is not hit on nginx

I'm using nginx with proxy_cache. And I'm looking for the way how to redirect to upstream servers if proxy_cache is not hit, to save proxy server outbound traffic. If cache is there, return cache. ...
0
votes
0answers
16 views

Nginx 502 Error with php-fpm depending on hostname

I'm using Nginx to serve out a web page using the Grav CMS which runs on PHP. I am using php-fpm to achieve this with Nginx. Everything seemed to work fine at first, but then I started getting a 502 ...
0
votes
1answer
29 views

Nginx 403 Forbidden

after trying three times in other StackExchange Forums, I hope I'm getting an answer here. I switched my wordpress webserver from apache2 to nginx (please note that I want to use the existing ...
1
vote
1answer
16 views

How to configure multiple nested subdirectories in Nginx using wildcards?

👋 Sorry if this was asked before. I've searched, but couldn't find anything close to what I'm trying to accomplish and I would appreciate any indication that could get me closer to solving this. 😊 ...
1
vote
1answer
13 views

Non-standard site directories

You know that by default, servers like nginx and apache use standard directories for sites. Like "public_html", "www". And I noticed that on multi-user setups the sites are placed in the user's home ...
0
votes
0answers
13 views

Converting conditional (if statement) mod_rewrite ruleset to nginx config

I have this Apache conditional mod_rewrite ruleset that (on request) subdomain.html.example.com dynamically opens a html page located in /home/user/source/html/subdomain/public_html/ otherdomain.html....
0
votes
0answers
17 views

Reverse proxied wordpress redirects to lan ip address

I installed wordpress on a CentOS7 LEMP and am accessing it behind a nginx reverse proxy (also on centos7). Everything was working fine until I played with the permalinks (maybe?). I reinstalled the ...
0
votes
0answers
15 views

Redirect URL with a subsequent direct URL as parameter has wrong port via nginx proxy

I have an existing service (MyApp) for which I wish to put an nginx proxy in front of. MyApp is directly accessible via: https://host123.example.com:8080/ The URL to access via the nginx proxy is: ...
1
vote
1answer
21 views

Mapping Old to new URL is not working in Nginx

I am moving my old Url's to the new one (it is more than 50) so I have placed the URLs in a file but the redirection is not happening. map_hash_max_size 262144; map_hash_bucket_size 262144; map $uri ...
0
votes
0answers
28 views

Nginx pass my request to default or local address

There is two issue with NGINX configurations. I tried to setup prestashop on CentOS 7 with Nginx according to this instrument that I found similar this in Prestashop forums . the nginx.config file ...
1
vote
3answers
80 views

How to reduce IO wait when serving large static files on NGINX?

I am wondering how to setup NGINX to server large (1-4 GB) static files without killing disk I/O wait caused by simultaneous reading. How do file-servers achieve this?
-2
votes
0answers
34 views

WWW to https:// nginx [on hold]

No matter what the visitor types www.example.net or http://www.example.net or http://example.net i want all of the requests to be redirected to https://example.net currently i have managed to ...
0
votes
0answers
20 views

Configuring Nginx as PHP Webserver and Reverse Proxy using HTTPS [on hold]

I am trying to use Nginx as Webserver and Reverse Proxy with HTTPS on my personnal webserver (debian, nginx, php 7, mariadb), but with my conf, something seems to not work "ERR_INVALID_RESPONSE", but ...
0
votes
1answer
33 views

Nginx redirects all websites to another website

I've been facing some weird issue. I have 2 WordPress websites installed on my server. I will call them, example1.com, example2.com All 2 websites run on Nginx, PHP-7.2, MariaDB and Ubuntu 18.04. ...
0
votes
1answer
8 views

Overriding nginx deny rule for acme related block

I have following nginx server config: server { ... location / { # First attempt to serve request as file, then # as directory, then fall back to proxy. ...
0
votes
2answers
47 views

How can i pass HTTPS to another server

What im trying to do is have Nginx sit in the middle on a dedicated server and then when it sees a connection on anything.(localport).vm.example.net it passes the connection to 127.0.0.1:localport (...
0
votes
1answer
38 views

Port .htaccess rewrite rule to Nginx

I'm moving from Apache to Nginx and would like to 'port' a rule from my htaccess file: RewriteRule ^api/(.*) slim/index.php [QSA,L] How can I do this in Nginx? An example of a request-url that ...
0
votes
0answers
9 views

Should I only use Gunicorn for my Django app? [duplicate]

I have a django project that only has APIs which the clients will use and no static contents. I wanted to know if it is good practice to deploy my project using only Gunicorn with some process ...
0
votes
0answers
8 views

Quick php upgrade on nginx webserver

I need to do a php version upgrade on clients production server. (current is 7.0 need to upgrade to 7.2). Since this is production environment, I need as little downtime as possible. What would be the ...
2
votes
1answer
35 views

NGINX Rewrite subdomain with multiple . as -

On my NGINX server, I am rewriting usernames as a subdomain. However, the server that I inherited, the initial names have a "." to separate out two names. For example: http://foo.com/john.smith is ...
1
vote
2answers
73 views

Docker + Nginx + PHP-FPM error: [emerg] 1#1: host not found in upstream

I have been on this error for 3 (full days) and still trying to figure out the issue and at the same time contemplating suicide :) I have a docker setup for LEMP stack that I cloned from this repo: ...
1
vote
1answer
27 views

Nginx variable in proxy pass does not work

Can proxy_pass work with variables? I am trying to make the below configuration work: http { ... map $http_user_agent $myvariable { default 'mobile'; } ...
-2
votes
1answer
31 views

Strange server access logs

Every morning, I monitor access logs to filter out bots and malicious attempts to break in. I keep noticing this same type of log. Example output (website and IP address are hidden): 8232 xxx.xxx....
0
votes
0answers
7 views

How serve files in folder with case insensitive on linux with nginx

I'm having a little problem. I need serve files with case insensitive for a folder, i use nginx: Original: https://example.com/media/catalog/product/b/t/bt2501_brandy.jpg https://example.com/media/...
1
vote
1answer
16 views

try_files inside of nginx if breaks logic

I wanna make nginx.conf that: - on post proxy_pass on different port - on get returns static files with index.html (serves SPA) How do I make that, currently I have: nginx.conf: worker_processes ...
1
vote
1answer
14 views

Nginx and FastCGI Configuration issue

I am running WordPress Multisite/Network and would like to have FastCGI keep the cache for an extended period of time (say a week or month). Reason being, we have a plugin that forces the cache to ...
-1
votes
0answers
33 views

Why do files take a very long time to get downloaded from my web server via HTTP requests? [closed]

I set up a web server on Ubuntu 18.04 (tried both Apache and NGINX) and configured virtual hosts and everything. I am serving a folder on the virtual host containing files (Directory Listing enabled) ...
0
votes
2answers
22 views

nginx https auto redirect to specific port

I'm not sure if the subject is resuming correctly my question but I'll try to explain it. I have the configuration below in my server, this server has 2 vhosts: example.com and meudomain.com The ...
0
votes
1answer
13 views

Nginx capture regex from server name

server { listen (my server ip):80; server_name ^(.[^\.]+)(\.)(\d+)\.vm\.example\.net$; location / { return 200 '$2'; add_header Content-Type text/plain; } } what i am ...
-2
votes
0answers
26 views

How to architect ECS Fargate PHP App [closed]

As Docker runs single process in foreground I use Supervisord to run both Nginx and PHP-FPM on a single container. What would be an alternative / right design for such stack? Should I have separate ...
0
votes
1answer
23 views

Is it a good idea to use nginx $request_id for CSP nonce value?

To set up strict-dynamic CSP source it's required to maintain a unique nonce value per request. The recommended way to do it according to this article is with: set_secure_random_alphanum $cspNonce ...
1
vote
1answer
18 views

Kubernetes nginx-ingress load balancer external IP pending

In my Kubernetes cluster I want to bind a nginx load balancer to the external IP of a node. However, the external IP is always shown as "pending". The cluster runs on two root-servers using weave. ...
0
votes
1answer
22 views

Add header in Nginx ONLY when retry

We configured nginx to retry requests to another server in the upstream upon timeout and error via: proxy_next_upstream http_503 timeout; proxy_next_upstream_tries 2; But we'd like the second server ...
1
vote
0answers
31 views

Cannot allocate memory error in nginx with huge number of redirections

I faced with memory allocation error in nginx. I have configured a reverse proxy for a number of sites on my nginx, that I use as a simple load balancer between two backend nodes. Typical config for ...
0
votes
1answer
32 views

NGINX: Is possible to get how many times an user hit my vhost?

I am using the nginx limitreq directive nowadays and I want to replace it by Google recaptcha instead of blocking the user right away... I can do this in my app but I was trying to make nginx help in ...
0
votes
1answer
15 views

how to point parts of a single url to 2 different servers using nginx

I have pointed a location /tanya to an address http://52.221.238.24/tanya;, I also want /tanya/t/ to point to the same IP. However, I need to point /tanya/dynamically_generated to point to another IP ...
0
votes
1answer
21 views

Limit open ended byte requests

I'm serving a some larger static files through an nginx proxy, and most clients requests these with range requests. My undrstanding is that when the request is made with a header of Range: bytes=0- ...
0
votes
1answer
31 views

can nginx set variable from file?

server { set $serverNames /www/test.txt; server_name $serverNames; ... I want to know if I can read the content from the text and assign it to the variable.I tried the above code and it ...
1
vote
1answer
35 views

Website as a sub location of another website?

Im trying to configure a website as a sub location of another website. For more context, i have wp1 and wp2, both wordpress sites, and wp2 needs to be a sub location of wp1, like http://wp1.com/wp2 ...
-2
votes
0answers
16 views

configure nginx to redirect to new URL

I have a Wordpress site run on nginx which calls a Code Igniter URL from a Wordpress template to display page inside Wordpress page. I would like to configure nginx.conf to redirect from url /...
9
votes
1answer
314 views

Nginx simple redirect of products from old to new category

I'm making redirects of products from old to new category. I've managed to make it work with following rule: rewrite ^/old-category/(.*) /new-category/$1; But I want to know when should I use "end ...
1
vote
1answer
24 views

NginX - allow - custom error page

This is rather interesting Guys! I have the following code in one of my webapplications NginX configuration: location /login { #access_log off; proxy_pass https://public; ...
0
votes
0answers
7 views

Nginx configuration to prevent spam connections on HTTP long polling endpoint [duplicate]

I have a HTTP long polling endpoint that anyone can connect to for updates. The nature of the application requires the solution to be open, it cannot sit behind any form of authentication. The server ...
1
vote
1answer
17 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
1answer
26 views

serve two different apps (two domains) on same ip address with nginx

I am trying to configure nginx to serve two differents sites on the same IP address, and I'm having trouble to make this work. server_tokens off; # hide nginx version # site1.com app is served from ...
1
vote
0answers
19 views

Getting SSL to work with reverse NGINX proxy in front of two Docker containers

Been struggling with this for a couple of hours. I know I'm missing something simple here because everything works on my localhost as SSL with self-produced certs + it works totally fine on localhost. ...