All Questions
975
questions
315
votes
26
answers
511k
views
How to clear the cache of nginx?
I use nginx to as the front server, I have modified the CSS files, but nginx is still serving the old ones.
I have tried to restart nginx, to no success and I have Googled, but not found a valid way ...
237
votes
8
answers
253k
views
Have nginx access_log and error_log log to STDOUT and STDERR of master process
Is there a way to have the master process log to STDOUT STDERR instead of to a file?
It seems that you can only pass a filepath to the access_log directive:
access_log /var/log/nginx/access.log
...
190
votes
32
answers
558k
views
nginx.service failed because the control process exited
nginx.service failed because the control process exited
$ systemctl status nginx.service
nginx.service - Startup script for nginx service
Loaded: loaded (/usr/lib/systemd/system/nginx.service; ...
58
votes
10
answers
84k
views
how to disable direct access to a web site by ip address
I have a website on a VPS.
The issue I am having is that when I enter the IP of the server, it links to the website.
Even when entering mail.domain.com, it does the same thing.
How do I disable that,...
43
votes
3
answers
30k
views
nginx map directive: why is it allowed only on http level?
There is a very useful directive in Nginx map.
But it is possible to use it only on the http level (see docs here http://nginx.org/en/docs/http/ngx_http_map_module.html#map).
For example, I have a ...
34
votes
2
answers
63k
views
DNS Records Redirect www to non-www
I'm using Namecheap Domains and Vultr Hosting.
I'm trying to redirect DNS www to non-www.
www.example.com to example.com
I contacted Vultr and asked how to do this with their DNS Manager, they ...
32
votes
6
answers
104k
views
X-Frame-Options in nginx to allow all domains
I'm using nginx as a reverse proxy for my website.
I want to be able to open my website in an iFrame from a chrome extension new tab html file.
For this, I need my nginx to set X-Frame-Options to ...
29
votes
1
answer
90k
views
Nginx location configuration (subfolders)
lets say I've a path like:
/var/www/myside/
that path contains two folders... let's say
/static and /manage
I'd like to configure nginx to have an access to:
/static folder on / (eg. http://example....
29
votes
3
answers
3k
views
nginx set remaining count for limit_req in X-RateLimit-Remaining header
I'm actually a little surprised that I couldn't find anything after a couple hours of googling, but the problem is as follows:
I want nginx to serve as my throttle for my API.
My config file ...
27
votes
4
answers
15k
views
Chrome ignores the ETag header and just uses the in memory cache/disk cache
If I understand correctly, the flow for using ETags works as described now:
Browser sends the request to the server. Server sends back the image with an ETag
Browser saves the ressource along with ...
25
votes
2
answers
34k
views
Can i deploy my .war on an nginx server
I really love nginx for the stability and way
requests are handled.
And i really love tomcat for the java
and the user friendliness
Is there a way to deploy my .war on a nginx server ?
25
votes
1
answer
35k
views
What is the nginx equivalent of .htaccess
I have shifted my web hosting which support nginx only. But i have no daam idea about it. Just wanted to know what is the .htaccess equivalent for nginx. What should be its file name, where should it ...
23
votes
2
answers
23k
views
nginx keep port number when 301 redirecting
I'm trying to collapse a second brand of a web app into the first brand and use 301 redirects to redirect any lingering traffic. The server is running in a Vagrant box forwarding on port 8001. I would ...
22
votes
3
answers
39k
views
nginx: "/root/index.html" forbidden (13: Permission denied)
I am installing nginx. Here is the steps I followed:
Make index.html file in /root directory
edit /etc/nginx/nginx.conf. After edit it looks like this:
user nginx;
worker_processes 1;
error_log /...
22
votes
1
answer
30k
views
How to setup NGINX to deploy different Single Page Apps (SPA's... i.e static files) depending on location (under same server_name) with subroutes
My goal is to setup two different single page apps (SPA) under the same domain, where we show the SPA corresponding to the location / path requested. I also want to default to one of the two SPA's on /...
16
votes
5
answers
62k
views
Nginx connect() failed error
I don't know why I got this error every time I tried to open the page:
2013/04/06 17:52:19 [error] 5040#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0....
16
votes
3
answers
9k
views
Gunicorn + nginx - Ignoring EPIPE
I have an nginx-gunicorn-flask setup running on google compute
and I keep getting the following from gunicorn:
[2019-04-19 20:50:49 +0000] [3345] [DEBUG] POST /
[2019-04-19 20:50:49 +0000] [3345] [...
15
votes
1
answer
15k
views
Why is the gzip minimum length directive not being respected?
If I understand correctly it's better not to gzip small resources as they might actually get bigger while still having a performance hit on the CPU.
So using the gzip_min_length directive is an ...
14
votes
2
answers
3k
views
Does nginx HttpLimitReqModule support per hour/day/week?
I seek a solution to do rate limit for HTTP API, for Nginx, there is already a module HttpLimitReqModule support this feature. But refer to the document, this module only supports per second and per ...
13
votes
1
answer
13k
views
Only allow certain countries traffic access specific page
I am using --with-http_geoip_module for identify traffic. There are some pages that I only want certain country to access. Here is configuration:
For http
http{
geoip_country /usr/share/GeoIP/...
13
votes
1
answer
6k
views
Is HTTPS behind reverse proxy needed?
I have an API server running behind an nginx reverse proxy. It is important to have all requests to my API server be secured via TLS since it handles sensitive data.
I've setup nginx to work with TLS ...
12
votes
3
answers
31k
views
nginx.conf and nginx.pid users and permissions
I'm embarking on watching my NGINX error.log files at level: warn... probably a silly idea and will cause me to crash my server as I work out any bugs happening, but hey, we're nerds and this is why ...
11
votes
1
answer
28k
views
Nginx - Redirect domain to localhost:port content
I installed Nginx on my server (my server uses WHM). And on this server has two accounts. Each account will run a server a NextJS site and each account has its own domain.
Site1 will run on port 3000
...
10
votes
1
answer
17k
views
Nginx reverse proxy setting
I am totally new to Nginx and need your help.
Basically I have a single server with single IP address, but I want to host two different web application within the server with different domain name. So,...
10
votes
1
answer
3k
views
NGINX + Flask, without Gunicorn?
I am new to this, but by comparing the code of gunicorn with flask/werkzeug, I fail to understand the real benefit of inserting gunicorn between nginx and flask. Would like to get some expert opinions ...
10
votes
3
answers
29k
views
Converting RTMP to RTSP in NGINX
I have a question, if I use nginx for RTMP stream, can this function to stream video with RTSP?
What are the differences between RTSP and RTMP? Can I use my RTMP server to stream with the RTSP ...
9
votes
2
answers
7k
views
How to setup routes with Express and NGINX?
I'm trying to configure an Express server with NGINX as a reverse proxy. NGINX to serve static files, and Express for the dynamic content.
Problem : The normal root link works (website.com) , but ...
9
votes
1
answer
11k
views
Maximum recommended client_max_body_size value on Nginx
What is the maximum recommended value of client_max_body_size on Nginx for upload of large files?
The web app that I'm working right now will expect uploads of max 100mb. Should I set ...
9
votes
2
answers
32k
views
Gunicorn not starting throwing gunicorn.service: Failed with result 'exit-code'. error
I'm trying a deploy simple Django application on Digital Ocean by following this link I follow every work step by step and successfully run that project via python manage.py runserver where it's not ...
9
votes
2
answers
14k
views
Redirecting HTTP POST requests to HTTPS POST requests
I recently just setup my server to run over HTTPS with an SSL certificate. The website is an image host and the developers at ShareX have included my site in their application.
My problem is, all ...
9
votes
1
answer
6k
views
Debugging 502 Bad Gateway error - Ubuntu, Nginx, Unicorn
I have an EC2 instance, trying to run a Rails app with Nginx and Unicorn.
I keep getting a 502 Bad Gateway error after about 60 seconds:
Here's what I get in the nginx error log:
2017/02/10 18:03:...
7
votes
1
answer
14k
views
nginx php-fpm failed to open stream permission denied
I have a php file on my NGINIX(with php-fpm) that create a simple txt file.
<?php
$content = "some text here 123 myText.txt";
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");
fwrite($...
7
votes
1
answer
5k
views
Nginx: Serve multiple Laravel apps with same url but two different sub locations in Linux
I want to serve multiple Laravel apps in a single nginx server, the first one has a root directory in /var/www/html/app1, the second one has /var/www/html/app2, and so on. The index.php file of each ...
7
votes
2
answers
12k
views
Call timed out (error 1006) - bigbluebutton
I have installed bigbluebutton on my serverand it was working properly but suddenly microphone can not connect anymore and after a while being stucked in "echo test" i'll get 1006 error and ...
7
votes
1
answer
6k
views
Nginx "location ~ ." vs "location ~* \."
Is there a difference between the 3 following directives?
location ~* \.(png)$ {
expires max;
log_not_found off;
}
location ~ \.(png)$ {
expires max;
log_not_found off;
}
location ~ .(png)$ ...
7
votes
2
answers
970
views
Someone trying to get into my server?
I hosted my Rails application last week. Today I was going through our log file and noticed lots of request like this.
I, [2016-03-14T00:42:18.501703 #21223] INFO -- : Started GET "/testproxy.php" ...
7
votes
2
answers
558
views
"SecCollectionTimeout is not yet supported" in WAF owasp modsecurity crs with NGINX
I install nginx with WAF (Using Docker)
mkdir -p /usr/src \
&& cd /usr/src/ \
&& git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/...
6
votes
1
answer
30k
views
Why am i getting error: recv() failed (104: Connection reset by peer) while reading response header from upstream during ajax request
I had problem with ajax. It always stopped working 5 min after request. I did't know what was causing it. I looked on many pages to find a sollution but nor provide good one. What I can do ?
6
votes
3
answers
8k
views
How to install latest version of nginx on raspbian?
What to specify in source.list? because when I write
deb http://nginx.org/packages/debian/ jessie nginx
deb-src http://nginx.org/packages/debian/ jessie nginx
appears error:
Unable to find expected ...
6
votes
1
answer
6k
views
Secure https with nginx for Private IP address
Problem : I want to run nginx with https, like https://192.168.100.110
What I've tried : I've followed the quick guide at https://www.humankode.com/ssl/create-a-selfsigned-certificate-for-nginx-in-5-...
6
votes
2
answers
2k
views
Nginx: log the actual forwarded proxy_pass request URI to upstream
I've got the following nginx conf:
http {
log_format upstream_logging '[proxied request] '
'$server_name$request_uri -> $upstream_addr';
access_log /dev/stdout ...
6
votes
1
answer
818
views
Transfer file takes too much time
I have an empty API in laravel code with nginx & apache server. Now the problem is that the API takes a lot of time if I try with different files and the API responds quickly if I try with blank ...
6
votes
0
answers
3k
views
how to check nginx is serving static file or not
This is my nginx.conf file. i want to serve all static contents that are located in different directories.
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log ...
6
votes
2
answers
6k
views
How to handle multiple ssl server with nginx
I have 2 SSL webservers that I have to handle with nginx.
I also have a http server (the redirection works fine).
The redirections works well when i handle just http and https (only one ssl webserver)...
5
votes
2
answers
21k
views
NGINX: Redirect a user based on cookie for a specific URL only
I'm building a closed social network and currently when a user is not logged in they will always be redirected to the homepage of my domain.
What I would like to do is do the following:
Use NGINX ...
5
votes
1
answer
28k
views
Connection Refused and access forbidden by rule Errors, how to solve?
Can anyone here please with those errors lines
I don't know too much about servers config
my server is on centos and managed by CWP panel
web server config; nginx-apache-php-cgi
hosting Wordpress ...
5
votes
2
answers
6k
views
Why does wiki.js need public URL when installing?
After configuring my database and running my Wiki.js instance using nodejs, I was prompted to "install" Wiki.js on localhost:3000. However, there is this input bar asking for the public URL ...
5
votes
1
answer
5k
views
413 Request Entity Too Large uploading files with Django Admin and Nginx Configuration
Whenever I upload a small file, such as an image, the data is saved successfully. However, when I upload an audio file I get this error: 413 Request Entity Too Large. The file sizes are around 8MB. ...
5
votes
2
answers
6k
views
Nginx with sub locations
I'm trying to setup a dev server with nginx for two projects, one in rails and one in PHP. I want a base URL (dev.example.com) for both projects and a sub location for each one (dev.example.com/...
5
votes
1
answer
10k
views
Nginx SSL Handshake Error
I am getting following error in my server log :
[crit] 915#0: *46701 SSL_do_handshake() failed (SSL:
error:140A1175:SSL routines:SSL_BYTES_TO_CIPHER_LIST:inappropriate
fallback) while SSL ...