Skip to main content

New answers tagged

1 vote
Accepted

Certbot failing on nginx reverse proxy: 404

The error indicates that the Let's Encrypt challenge request is not being properly served by Nginx. Make sure that your domain pacsa.us is correctly pointed to your server's IP address. You can use ...
Max Haase's user avatar
  • 521
0 votes

Nginx 404 - Nginx redirecting every page to 404 not found (nginx 404 page) for all of the sites with html status code 200

This problem was caused by malware where every parent folder inside all the sites located in /var/www/ got injected with 3 malware files: wp-blog-header <?php goto oPQ84; FhY1N: INQR_(array("\...
MJ Sabri's user avatar
  • 101
0 votes
Accepted

Nginx docker file upload permission denied

So the solution was simpler than I thought... I went into the docker container bash, chown-ed the /usr/share/nginx/html folder for nginx user and group, and it started working. I then checked ...
Gábor Major's user avatar
0 votes

recv() failed (104: Unknown error) while proxying upgraded connection in nginx

http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; ...
warashi nguyen's user avatar
0 votes

PHP Unable To Write To Cache Directory

The cause of the issue was SELinux, by running the below command it solved the issue. setsebool -P httpd_unified=1 You can set more specific rules which is recommend but for my issue, the above ...
llanato's user avatar
  • 211
1 vote

Nginx strapi increase upload body size for /upload/

server { # Listen HTTP listen 80; server_name myapi.tld; access_log /var/log/nginx/myapi/myapi.log; error_log /var/log/nginx/myapi/myapi.error.log; # Redirect HTTP to HTTPS ...
warashi nguyen's user avatar
1 vote

PHP Unable To Write To Cache Directory

If PHP cannot write to the cache directory, it may be due to incorrect file permissions. Make sure that the cache directory has the correct permissions and ownership. Alternatively, the problem may ...
Baba Bhuvanesh's user avatar
0 votes

Linux & nginx - multiple servers on same network

So you have one external IP with multiple domains and want to serve them from server 1 or 2 based on the domain name, all using the same port? It’s kind of doable. Essentially you can configure server ...
Robert Glonek's user avatar
0 votes

Nginx vhost logging not working as expected

The problem was due to the missing semicolon at the preceding directive. I am not sure why I didn't see this before (and I was looking) but after a couple of restarts and trial-and-error attempts, I ...
Alexander L. Belikoff's user avatar
0 votes

Connection Refused Error Nginx Nodejs

Has been 6 years since then... I also ran into this, in my case, I happened to find out that Google Chrome changed my URL protocol from "http://" into "https://" (no idea what ...
maverickpuss's user avatar
0 votes

Nginx reverse proxy for home assistant not working

With those logs talking more about docker than nginx itself. It's hard to know what's exactly causing this. Try posting /var/log/nginx/error.log. As you are reverse proxying an https link, You can try ...
montepinar's user avatar
0 votes

ngx_http_geoip_module module version is wrong after updating nginx on CentOS and nginx won't start

I don't know if anyone else has come across this solution. I had the same issue up above but after the sudo apt upgrade, I ran a sudo apt --fix-broken install and this fixed nginx and restarted the ...
cbloss793's user avatar
0 votes

Can’t run fcgiwrap and set permissions when installing bugzilla on ubuntu + nginx

Thanks for answers! I found a solution on how to start a socket to make the site work: spawn-fcgi -s /var/run/fcgiwrap.sock -M 755 -u www-data -g www-data /usr/sbin/fcgiwrap The only thing left. I ...
7tunnel's user avatar
0 votes

Can’t run fcgiwrap and set permissions when installing bugzilla on ubuntu + nginx

If you have installed fcgiwrap via apt on Ubuntu, the correct way to start it is with included systemd unit: sudo systemctl enable fcgiwrap sudo systemctl start fcgiwrap sudo systemctl status fcgiwrap ...
Peter Zhabin's user avatar
  • 2,931
1 vote

How to run multiple email domains with port splitting? (like nginx proxy)

Email protocols don't have a mechanism to tell which hostname is used. The HTTP protocol has the Host header that can be used to forward different requests to different backends at the reverse proxy. ...
Esa Jokinen's user avatar
  • 50.2k
0 votes

NGINX redirect dynamic page to another website

You cannot use the query string (anything from the ? and after) in a location expression or a rewrite regex. It has already be removed from the optimised URI and placed in the $args variable. You can ...
Richard Smith's user avatar
0 votes

Check if a subdomain is in a list of subdomains and use a different proxy_pass depending on if the subdomain is in the list. Using wildcard

Use two server blocks. server { # old domains (all subdomains except mentioned in next server block) server_name .example.com; location / { proxy_pass http://localhost:8090; ...
Alexey Ten's user avatar
  • 8,862
0 votes

Pm2 cannot open it's own PID file on ubuntu 18.04

It could be a SElinux issue (as pid file or files are by default created under /home directory and not under /run/ and because of non-standard location SElinux blocks it) Related to pid file -...
Miika Nurminen's user avatar
0 votes

Possible to override $fastcgi_script_name in Nginx?

Rewriting SCRIPT_FILENAME (assuming, your CGI program actually prefers it over other means) is actually what gets you the desired results. Especially in case when your script is NOT in your webroot (s....
AnrDaemon's user avatar
  • 271
0 votes
Accepted

Are additional changes necessary for worker_rlimit_nofile to take effect?

In my case [Ubuntu server (22.04) with Nginx (1.18)] no additional changes are required. So I just need to update /etc/nginx/nginx.conf: user www-data; worker_processes auto; worker_rlimit_nofile 4096;...
PeraMika's user avatar
  • 101
2 votes
Accepted

How can multiple NGINX pods in Kubernetes write logging into their own separate files?

Indeed this type of question is common. Here is one way to accomplish it. Create NGINX Config Template: Use placeholders for pod-specific log paths. Init Container: Replace placeholders with actual ...
Max Haase's user avatar
  • 521
0 votes

How to build an nginx conf to accommodate wildcards in location?

I figured it out, this is the right format server { location ~ ^(/deployments/).*(xx).* { proxy_pass $uri; proxy_set_header custom-header val1 } location ~ ^(/deployments/).*(yy)...
Shreyas Kulkarni's user avatar
0 votes

Debugging Gunicorn + Nginx + Django

Make sure you are running Gunicorn correctly. It should be running from your project's directory, and you may want to specify the Django WSGI application. Example: gunicorn --bind 127.0.0.1:8888 ...
Max Haase's user avatar
  • 521
0 votes

Nginx not working with domain/url that points to server IP

add these two lines in your /etc/hosts 127.0.0.1 your_domain 127.0.0.1 www.your_domain then you will be able to access those via http://your_domain or http://www.your_domain try restarting nginx by ...
Anuj Tiwari's user avatar
0 votes

Manage self compiled Nginx via systemd

considering the nginx official documentation has changed, I feel I should post this updated information. They removed the systemd service example from the official nginx website link that was ...
drhax9955's user avatar
1 vote

Non-www not redirecting to www HTTPS Nginx

(failed) net::ERR_NAME_NOT_RESOLVED means that there is no DNS entry for www.example.com. Check your DNS provider to confirm that you have either an A record or a CNAME record for www.
tsc_chazz's user avatar
  • 2,232
2 votes

2 websites, 2 DNS, 1 Nginx server, sharing a port - How do I direct requests to the correct server block?

My questions is, first of all, can this be done (2 domains, 2 DNS, 1 server, sharing the same port)? Yes this can be done. First of all, let's correct a few mistakes: as it is stated in the ...
Lou's user avatar
  • 23
0 votes

Nginx serves all file types as MIME type: "text/html on NixOS

Thanks to Alexey Ten I found the solution. I moved most of the original configuration for the "/" location to "~ \.php$". locations."~ \\.php$" = { ...
imposiblaa's user avatar
0 votes
Accepted

Nginx duplicate location "/.well-known/acme-challenge/"

We experienced the same issue after a recent update to nginx/nginx-proxy and nginxproxy/acme-companion. You should remove the following volume from the letsencrypt-companion service in the docker-...
totallyben's user avatar
0 votes

Nginx duplicate location "/.well-known/acme-challenge/"

In your default config, check the lines include /etc/nginx/vhost.d/default;. My guess is that the config is recurisvely importing itself. Try removing/commenting out these imports and try again.
Jürgen Haan's user avatar
0 votes
Accepted

What must nginx setup be to host an application in a sub folder

The edit was the same as the question, diffing them I see only an added empty nonbreaking space. To serve both your Django app and Vue app on the same domain using Nginx, you need to ensure the ...
Max Haase's user avatar
  • 521
2 votes
Accepted

nginx configuration being ignored

You have three "default" server blocks, as there are three blocks without a server_name or using the bogus name _. See the documentation on the catch-all server. So any request appearing on ...
Richard Smith's user avatar
0 votes

Configure QUIC and HTTP/3 in Ubuntu

Ubuntu 24.04 uses nginx/1.24.0 which does not support http/3. You have to compile it by yourself or use something like eg Fedora with new nginx/1.26.0
defim's user avatar
  • 101

Top 50 recent answers are included