Quantcast
Channel: Nginx Forum
Viewing all 53287 articles
Browse latest View live

error: nginx.spec:28: bad %if condition nginx-1.13.7-1.el7_4.ngx.src.rpm

$
0
0
[root@centos-7-4 ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

rpmbuild --rebuild nginx-1.13.7-1.el7_4.ngx.src.rpm

sh: lsb_release: command not found
error: /root/rpmbuild/SPECS/nginx.spec:28: bad %if condition

Listen ssl

$
0
0
Здравствуйте, помогите христа ради.

Есть три файла в sites-enabled, в каждом описано:

server {
listen 8080;
server_name <name>;

ssl on;

ssl_certificate <path>.crt;
ssl_certificate_key <path>.key;

ssl_session_timeout 5m;

ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;

location / {
proxy_pass http://127.0.0.1:<local port>/;
}
}

Если в одном из файлов убрать ssl, То он всё равно ожидает https (появляется ошибка о попытке отправки http запроса, на https порт).
Подскажите пожалуйста, почему появляется эта ошибка?

Re: Listen ssl

$
0
0
Здравствуйте.

Уберите из конфига ssl on;
Используйте вместо него параметр ssl к директиве listen.

27 ноября 2017 г., 12:24 пользователь Artemdno <nginx-forum@forum.nginx.org>
написал:

> Здравствуйте, помогите христа ради.
>
> Есть три файла в sites-enabled, в каждом описано:
>
> server {
> listen 8080;
> server_name <name>;
>
> ssl on;
>
> ssl_certificate <path>.crt;
> ssl_certificate_key <path>.key;
>
> ssl_session_timeout 5m;
>
> ssl_protocols SSLv2 SSLv3 TLSv1;
> ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+
> HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
> ssl_prefer_server_ciphers on;
>
> location / {
> proxy_pass http://127.0.0.1:<local port>/;
> }
> }
>
> Если в одном из файлов убрать ssl, То он всё равно ожидает https
> (появляется
> ошибка о попытке отправки http запроса, на https порт).
> Подскажите пожалуйста, почему появляется эта ошибка?
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?21,277519,277519#msg-277519
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru




--
WBR,
Vadim Lazovskiy
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Hi There

constant X-Cache-Status:MISS on woff files

$
0
0
I have a problem with cacheing.

Following location in my config - perfectly handles all the extensions jpeg, jpg and stuff.

location ~* \.(?:ico|pdf|flv|jpg|jpeg|png|gif|swf|x-html|woff|woff2|ttf|eot|map)$ {
gzip off;
expires 30d;
log_not_found off;
access_log off;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;
add_header X-Cache-Status $upstream_cache_status;

proxy_cache img_cache_main;
proxy_buffers 2048 64k;
proxy_buffer_size 128k;
proxy_set_header Host "HOSTNAME";

proxy_ignore_headers Cache-Control Vary Expires Set-Cookie X-Accel-Expires;
proxy_cache_valid 404 1m;

aio threads=default;
aio_write on;
output_buffers 16 1024k;
sendfile on;

proxy_pass http://HOSTNAME_appserver;
}


Unfortunately i get MISS on all woff files :/

Re: ngx_msec_t is 32bit on ARM

$
0
0
Hello!

On Sat, Nov 25, 2017 at 07:44:54PM -0500, teknopaul wrote:

> I'm trying to compile nginx on for a raspberry pi
>
> src/core/ngx_times.c
>
> time_t sec;
> ngx_uint_t msec;
> struct timeval tv;
>
> ngx_gettimeofday(&tv);
> sec = tv.tv_sec;
> msec = tv.tv_usec / 1000;
> ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;
>
> ngx_current_msec is defined as a ngx_msec_t which in turn is ngx_uint_t. In
> an rpi is not big enough to hold Unix epoc in millis. (sec * 1000)
>
> nginx code does compile, but my tests fail: they have hardcoded values for
> the epoc.
>
> Is this deliberate? I guess its cropping the high order bits? So millis
> comparisons might work but timestamps generated from this value might not?

Yes, this is intentional. The ngx_current_msec variable (and the
ngx_msec_t type) is to be used to effectively implement timers,
and hence it uses platform-specific fast integer. As such, it can
easily overflow on 32-bit platforms. You have to fix your tests.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: ngx_http_upstream_test_next u->peer.tries > 1

$
0
0
Hello!

On Fri, Nov 24, 2017 at 03:23:30AM -0500, crasyangel wrote:

> assume all servers always fail in upstream
>
> nginx would call ngx_http_upstream_next when u->peer.tries > 1, and call
> ngx_http_upstream_finalize_request directly when u->peer.tries == 1
>
> it would not pass NGX_PEER_FAILED to u->peer.free
>
> so how peer->fails increase when last retry fail?

The result of the last attempt is returned to the client as is,
and it is not considered to be a failure regardless of other
settings. In the edge case when there is only one server,
requests are simply passed to the server.

If there is more than one server, and all servers fail, the first
request will disable all servers but the last one (assuming
default max_fails=1), and the second request will disable the last
server.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: 400 bad requests now returning http headers? ( crossdomain.xml )

$
0
0
Hello,
this is possible too late but may useful

I have'nt found any solution
and just recompiled the Nginx with a little patch

i've changed file ./src/http/ngx_http_request.c

in function ngx_http_create_request:

r->http_version = NGX_HTTP_VERSION_10

to

r->http_version = NGX_HTTP_VERSION_9

this may ugly but now working as expected

Re: cts-submit

$
0
0
On 2017-11-26 at 14:17 +0100, A. Schulze wrote:
> Hello,
>
> experiments with nginx-ct ¹) show that I need a tool to submit a certificate to some public logs.
> cts-submit ²) seems useful. But it require me to install php on every host :-/
>
> I know there are also python implementations. but
> is anybody aware of an implementation in *plain posix shell + openssl* ?
>
> Andreas

Doesn't your CA already submit them to the Certificate Transparency
logs?

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: cts-submit

$
0
0
You can use ct-submit, once built the binary can be copied and run on any
system without any dependencies.

https://github.com/grahamedgecombe/ct-submit

On Mon, Nov 27, 2017 at 10:21 PM, Ángel <nginx@16bits.net> wrote:

> On 2017-11-26 at 14:17 +0100, A. Schulze wrote:
> > Hello,
> >
> > experiments with nginx-ct ¹) show that I need a tool to submit a
> certificate to some public logs.
> > cts-submit ²) seems useful. But it require me to install php on every
> host :-/
> >
> > I know there are also python implementations. but
> > is anybody aware of an implementation in *plain posix shell + openssl* ?
> >
> > Andreas
>
> Doesn't your CA already submit them to the Certificate Transparency
> logs?
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Failed - Network Error When Downloading SMALL Files

$
0
0
Hi everyone,

I am about at my wits end with this problem.

We have a web application (written in PHP w/ Laravel) and a major feature of this application is to export a list of residents from properties. MOST properties do export and the CSV downloads successfully.

However, for large properties, it fails after ~60 seconds. I have attempted to change the settings to increase the timeout times in NGINX and the php.ini, but nothing seems to fix the issue. The files are only 50kb, or so, but the script takes a good amount of time to process and generate the CSV.

Every property works on my local development environment - so I know the code is functional.

My NGINX config (I am using Laravel Forge):

===================================
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/{site_name}/before/*;

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name default;
root /home/forge/{site_name}/current/public;

# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/{site_name}/273139/server.crt;
ssl_certificate_key /etc/nginx/ssl/{site_name}/273139/server.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!3DES';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

index index.html index.htm index.php;

charset utf-8;

# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/{site_name}/server/*;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

access_log off;
error_log /var/log/nginx/{site_name}-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 120;
}

location ~ /\.(?!well-known).* {
deny all;
}
}

# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/{site_name}/after/*;

===================================

And my PHP.ini:

===================================
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 300

; Maximum request time before termination
request_terminate_timeout = 300s

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60

===================================

Paying for issue with ODBC

$
0
0
Hi,
I was wondering if someone is willing this freelance as I got stuck. Thinking that the problem was the php when i think its the NGINX connection to the PHP. The issue in hand is that trying to migrate an internal website which was on XAMPP to NGINX. I already migrated everything the issue is the connection to the Microsoft database SQL with the ODBC. I already installed all the packages and the php file gives connection. Whats odd is that when i go to the website and enter the username and password it should authenticate with the Microsoft database with it wont. I check the logs and get this

"PHP message: PHP Warning: odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect

If someone knows how to fix this feel free to pm or write a message. And we will talk about the price

Thank you

Re: error: nginx.spec:28: bad %if condition nginx-1.13.7-1.el7_4.ngx.src.rpm

$
0
0
Добрый день!
Посмотрите эту ошибку?

как правильно проксировать вебсокеты ?

$
0
0
Привет!

в официальной документации https://nginx.ru/ru/docs/http/websocket.html

есть пример

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}


получается, что соединение будет закрываться каждый раз.

не будет ли логичнее сделать

map $http_upgrade $connection_upgrade {
default upgrade;
'' '';
}

?

или это какая-то задумка ? расскажите ?

Илья Шипицин
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

[nginx] Fixed "changing binary" when reaper is not init.

$
0
0
details: http://hg.nginx.org/nginx/rev/8b84d60ef13d
branches:
changeset: 7162:8b84d60ef13d
user: Ruslan Ermilov <ru@nginx.com>
date: Tue Nov 28 12:00:24 2017 +0300
description:
Fixed "changing binary" when reaper is not init.

On some systems, it's possible that reaper of orphaned processes is
set to something other than "init" process. On such systems, the
changing binary procedure did not work.

The fix is to check if PPID has changed, instead of assuming it's
always 1 for orphaned processes.

diffstat:

src/core/nginx.c | 1 +
src/os/unix/ngx_daemon.c | 1 +
src/os/unix/ngx_process.c | 7 ++++---
src/os/unix/ngx_process.h | 2 ++
src/os/unix/ngx_process_cycle.c | 1 +
src/os/win32/ngx_process.h | 2 ++
src/os/win32/ngx_process_cycle.c | 1 +
7 files changed, 12 insertions(+), 3 deletions(-)

diffs (109 lines):

diff -r 325b3042edd6 -r 8b84d60ef13d src/core/nginx.c
--- a/src/core/nginx.c Thu Nov 23 16:33:40 2017 +0300
+++ b/src/core/nginx.c Tue Nov 28 12:00:24 2017 +0300
@@ -228,6 +228,7 @@ main(int argc, char *const *argv)
#endif

ngx_pid = ngx_getpid();
+ ngx_parent = ngx_getppid();

log = ngx_log_init(ngx_prefix);
if (log == NULL) {
diff -r 325b3042edd6 -r 8b84d60ef13d src/os/unix/ngx_daemon.c
--- a/src/os/unix/ngx_daemon.c Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/unix/ngx_daemon.c Tue Nov 28 12:00:24 2017 +0300
@@ -26,6 +26,7 @@ ngx_daemon(ngx_log_t *log)
exit(0);
}

+ ngx_parent = ngx_pid;
ngx_pid = ngx_getpid();

if (setsid() == -1) {
diff -r 325b3042edd6 -r 8b84d60ef13d src/os/unix/ngx_process.c
--- a/src/os/unix/ngx_process.c Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/unix/ngx_process.c Tue Nov 28 12:00:24 2017 +0300
@@ -194,6 +194,7 @@ ngx_spawn_process(ngx_cycle_t *cycle, ng
return NGX_INVALID_PID;

case 0:
+ ngx_parent = ngx_pid;
ngx_pid = ngx_getpid();
proc(cycle, data);
break;
@@ -371,12 +372,12 @@ ngx_signal_handler(int signo, siginfo_t
break;

case ngx_signal_value(NGX_CHANGEBIN_SIGNAL):
- if (getppid() > 1 || ngx_new_binary > 0) {
+ if (ngx_getppid() == ngx_parent || ngx_new_binary > 0) {

/*
* Ignore the signal in the new binary if its parent is
- * not the init process, i.e. the old binary's process
- * is still running. Or ignore the signal in the old binary's
+ * not changed, i.e. the old binary's process is still
+ * running. Or ignore the signal in the old binary's
* process if the new binary's process is already running.
*/

diff -r 325b3042edd6 -r 8b84d60ef13d src/os/unix/ngx_process.h
--- a/src/os/unix/ngx_process.h Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/unix/ngx_process.h Tue Nov 28 12:00:24 2017 +0300
@@ -54,6 +54,7 @@ typedef struct {


#define ngx_getpid getpid
+#define ngx_getppid getppid

#ifndef ngx_log_pid
#define ngx_log_pid ngx_pid
@@ -79,6 +80,7 @@ extern char **ngx_argv;
extern char **ngx_os_argv;

extern ngx_pid_t ngx_pid;
+extern ngx_pid_t ngx_parent;
extern ngx_socket_t ngx_channel;
extern ngx_int_t ngx_process_slot;
extern ngx_int_t ngx_last_process;
diff -r 325b3042edd6 -r 8b84d60ef13d src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/unix/ngx_process_cycle.c Tue Nov 28 12:00:24 2017 +0300
@@ -31,6 +31,7 @@ static void ngx_cache_loader_process_han
ngx_uint_t ngx_process;
ngx_uint_t ngx_worker;
ngx_pid_t ngx_pid;
+ngx_pid_t ngx_parent;

sig_atomic_t ngx_reap;
sig_atomic_t ngx_sigio;
diff -r 325b3042edd6 -r 8b84d60ef13d src/os/win32/ngx_process.h
--- a/src/os/win32/ngx_process.h Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/win32/ngx_process.h Tue Nov 28 12:00:24 2017 +0300
@@ -14,6 +14,7 @@ typedef DWORD ngx_pid_t;


#define ngx_getpid GetCurrentProcessId
+#define ngx_getppid() 0
#define ngx_log_pid ngx_pid


@@ -73,6 +74,7 @@ extern ngx_int_t ngx_last_pro
extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES];

extern ngx_pid_t ngx_pid;
+extern ngx_pid_t ngx_parent;


#endif /* _NGX_PROCESS_H_INCLUDED_ */
diff -r 325b3042edd6 -r 8b84d60ef13d src/os/win32/ngx_process_cycle.c
--- a/src/os/win32/ngx_process_cycle.c Thu Nov 23 16:33:40 2017 +0300
+++ b/src/os/win32/ngx_process_cycle.c Tue Nov 28 12:00:24 2017 +0300
@@ -31,6 +31,7 @@ static ngx_thread_value_t __stdcall ngx_
ngx_uint_t ngx_process;
ngx_uint_t ngx_worker;
ngx_pid_t ngx_pid;
+ngx_pid_t ngx_parent;

ngx_uint_t ngx_inherited;
ngx_pid_t ngx_new_binary;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

upstream zone size

$
0
0
What is a reasonable value for upstream zone size? I'm just shooting in the dark with 64k right now. Running 64bit Linux. The official NGINX documentation does not elaborate on it, and I can't find anything useful on Google.

upstream backends {
zone example_zone 64k;
keepalive 8l;

server 10.20.30.2 max_fails=3 fail_timeout=30s;
}

[nginx] Removed unused FreeBSD-specific definitions in ngx_posix_config.h.

$
0
0
details: http://hg.nginx.org/nginx/rev/fc0d06224eda
branches:
changeset: 7163:fc0d06224eda
user: Sergey Kandaurov <pluknet@nginx.com>
date: Tue Nov 28 13:09:54 2017 +0300
description:
Removed unused FreeBSD-specific definitions in ngx_posix_config.h.

diffstat:

src/os/unix/ngx_posix_config.h | 20 --------------------
1 files changed, 0 insertions(+), 20 deletions(-)

diffs (30 lines):

diff -r 8b84d60ef13d -r fc0d06224eda src/os/unix/ngx_posix_config.h
--- a/src/os/unix/ngx_posix_config.h Tue Nov 28 12:00:24 2017 +0300
+++ b/src/os/unix/ngx_posix_config.h Tue Nov 28 13:09:54 2017 +0300
@@ -145,26 +145,6 @@ typedef struct aiocb ngx_aiocb_t;
#define ngx_debug_init()


-#if (__FreeBSD__) && (__FreeBSD_version < 400017)
-
-#include <sys/param.h> /* ALIGN() */
-
-/*
- * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
- */
-
-#undef CMSG_SPACE
-#define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
-
-#undef CMSG_LEN
-#define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l))
-
-#undef CMSG_DATA
-#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
-
-#endif
-
-
extern char **environ;


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Nginx cache returns MISS after a few hours, can't be set up to cache "forever"

$
0
0
Hi,

I am trying to cache files "forever". Unfortunately in about 2-6 hours the cache starts to return MISS again. This is the setting:

---

proxy_cache_path /var/cache/nginx-cache levels=1:2 keys_zone=mycache:10m max_size=20g inactive=10y;

proxy_cache_valid 10y;

"Expires" header returned by the upstream is set to the year 2027 and "Cache-Control" to max-age=315360000 (i.e. 10 years).

---

I suppose, if was the expiry time the reason, it would have return EXPIRED, but not MISS.

The cache fills up to ~5 GB (from allowed 20 GB), so the space should not be the problem.

I have tried to remove all cached files and restart nginx, but it did not help.

For testing I use plain curl GET requests (without ETag, Vary, etc. headers) - always the same.

Thank you for any hint,
Jan Molic
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: Nginx cache returns MISS after a few hours, can't be set up to cache "forever"

$
0
0
Hi,

On Tue, Nov 28, 2017 at 12:32:32PM +0100, mig@1984.cz wrote:
> Hi,
>
> I am trying to cache files "forever". Unfortunately in about 2-6 hours the cache starts to return MISS again. This is the setting:
>
> ---
>
> proxy_cache_path /var/cache/nginx-cache levels=1:2 keys_zone=mycache:10m max_size=20g inactive=10y;
>
> proxy_cache_valid 10y;
>
> "Expires" header returned by the upstream is set to the year 2027 and "Cache-Control" to max-age=315360000 (i.e. 10 years).
>
> ---
>
> I suppose, if was the expiry time the reason, it would have return EXPIRED, but not MISS.
>
> The cache fills up to ~5 GB (from allowed 20 GB), so the space should not be the problem.
>
> I have tried to remove all cached files and restart nginx, but it did not help.
>
> For testing I use plain curl GET requests (without ETag, Vary, etc. headers) - always the same.

It's not only disk size that matters.
Cache entries may also be evicted when approaching the keyz_zone size.
Try increasing the zone size.

--
Roman Arutyunyan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: Nginx cache returns MISS after a few hours, can't be set up to cache "forever"

$
0
0
Can you count the number of files that are in your cache and whether or not it's changing with time?
Then compare with the number of unique cache keys (from your web server log)

When the server starts returning a MISS - does it only do this for newer objects that haven’t been requested before?
Does it happen for any objects that had previously been returned as a HIT?



> On Nov 28, 2017, at 6:32 AM, mig@1984.cz wrote:
>
> Hi,
>
> I am trying to cache files "forever". Unfortunately in about 2-6 hours the cache starts to return MISS again. This is the setting:
>
> ---
>
> proxy_cache_path /var/cache/nginx-cache levels=1:2 keys_zone=mycache:10m max_size=20g inactive=10y;
>
> proxy_cache_valid 10y;
>
> "Expires" header returned by the upstream is set to the year 2027 and "Cache-Control" to max-age=315360000 (i.e. 10 years).
>
> ---
>
> I suppose, if was the expiry time the reason, it would have return EXPIRED, but not MISS.
>
> The cache fills up to ~5 GB (from allowed 20 GB), so the space should not be the problem.
>
> I have tried to remove all cached files and restart nginx, but it did not help.
>
> For testing I use plain curl GET requests (without ETag, Vary, etc. headers) - always the same.
>
> Thank you for any hint,
> Jan Molic
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Viewing all 53287 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>