Re: internal, redirects and proxy_cache

2013-06-22 Thread Maxim Dounin
Hello!

On Sat, Jun 22, 2013 at 10:10:25AM +0100, Nic Ferrier wrote:

 A very related question was asked before here:
 
 http://forum.nginx.org/read.php?2,236720,236782#msg-236782
 
 But I'm not sure that asked exactly what I want to do.

It's not.  It's about caching of a response with 
an X-Accel-Redirect header, while your need to cache a response 
after an internal redirect.  What you need is expected to work 
fine, see below.

 I've got locations like this:
 
 location /packages/archive-contents {
 proxy_pass http://localhost:8005;
 proxy_http_version 1.1;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 }
 
 location /packages/archive-contents/ {
 internal;
 proxy_pass http://localhost:8005;
 proxy_http_version 1.1;
 }
 
 
 The first one calls out to the app server which sends an X-Forwarded-For
 to the second one, something like:
 
 http://host/packages/archive-contents/38381632639138

Correct header name is X-Accel-Redirect.  Correct value is 
/packages/archive-contents/38381632639138.  That is, header 
returned should look like:

X-Accel-Redirect: /packages/archive-contents/38381632639138

 I would like to cache that response so that nginx hit the app server
 from the first location which redirects to the 2nd location but that
 returns a cached response. 
 
 When the redirect from the first location changes the second location
 would have to cache it.
 
 
 Is that possible? I've tried adding proxy_cache to the 2nd location,
 like so:
 
 location /packages/archive-contents/ {
 internal;
 proxy_pass http://localhost:8005;
 proxy_http_version 1.1;
 proxy_cache marmaladerepo-cache;
 proxy_cache_valid  200 302  1d;
 proxy_cache_valid  404  60m;
 }
 
 but this doesn't seem to have an effect.

This should work assuming you are using correct header to trigger 
internal redirect, and the response returned doesn't disable cache 
(there is more than one way to do it, see 
http://nginx.org/r/proxy_cache_valid).

-- 
Maxim Dounin
http://nginx.org/en/donation.html

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


Re: No MIME types

2013-06-22 Thread Francis Daly
On Sat, Jun 22, 2013 at 03:15:30AM -0400, Peleke wrote:

Hi there,

I'm not sure how your question matches the Subject: line you used.

But anyway...

 The problem is the second domain.tld entry:

 2013/06/22 09:10:46 [error] 7806#0: *1 open()
 /var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css
 failed (2: No such file or directory), client: 5.6.7.8, server: localhost,
 request: GET
 /domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1
 HTTP/1.1, host: 1.2.3.4, referrer: http://1.2.3.4/wordpress/;

 How can I fix this?

I suspect that the answer is going to be fix your wordpress.

Does the file

  /var/www/domain.tld/htdocs/wordpress/wp-content/themes/twentytwelve/style.css

exist (without the second /domain.tld)?

What is the output of

  curl -i http://1.2.3.4/wordpress/

and does it include the string

  /domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1

anywhere? If so, what puts the /domain.tld at the start of it?

My guess is that the file does exist, and that the extra /domain.tld
is added by your wordpress. In which case, find where it your wordpress
config it is added, and don't add it.

Good luck with it,

f
-- 
Francis Dalyfran...@daoine.org

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


Fwd: question about running on multiprocessor

2013-06-22 Thread 고범규
-- Forwarded message --
From: 고범규 bk7...@gmail.com
Date: 2013/6/21
Subject: question about running on multiprocessor
To: nginx@nginx.org


Hi, I'm a beginner on this field.


I want just to do some simulation about multiprocessor programming.

What I'm trying to do is to test performance of nginx by using Apache
Benchmark.
So, I added server.max-worker = 8 to default nginx.conf
and ran Apache Bench through a command, ab -n 10 -c 1000
xxx.xxx.xx.xx.

However, server computer's max CPU utilization showed 30% as if it had just
2 cores.
Without max-worker=8, max CPU utilization is 15%, so it is sure that
there was some change.

How can I increase the CPU utilization to 100%, which is 8 core??

Followings are running environment,

O/S: Ubuntu 12.04 (in VIrtualbox4.2)
CPU: Intel, i7-3610QM (which has physical 4 cores, but virtually 8 cores
considering hyperthreading)
RAM: 4096MB
nginx: 1.4.1
Apache: 2.2

notes-I checked that CPU utilization can be 100% with another application.

If anyone has idea on this or needs more information about my setting,
please let me know.
Thanks in advance.
-- 
With regards,
Jason Koh (고범규)



-- 
With regards,
Jason Koh (고범규)
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: start time is out mp4

2013-06-22 Thread Richard Kearsley

Hi

nginx version: nginx/1.4.1
built by gcc 4.2.1 20070831 patched [FreeBSD]
TLS SNI support enabled
configure arguments: --with-debug --with-http_ssl_module 
--with-http_stub_status_module --with-file-aio --with-http_flv_module 
--with-http_mp4_module --with-http_geoip_module 
--add-module=../../../lua-nginx-module


upgraded version, still have mp4 errors at the same frequency

What do the stts and stsc errors mean? how can I find out what is 
causing them?


Thanks

On 22/06/13 11:28, Lukas Tribus wrote:

Hi Richard,



Given that the mp4 module works remarkably well on the whole, where
should I look to find the cause of these rare errors? (and what do they
actually mean :))

nginx version: nginx/1.2.9

I would suggest you upgrade nginx. Between nginx/1.2.9 and a recent releases
there are 4 bugfixes in the mp4 module.

Upgrade to nginx 1.4.1.


Lukas   
___
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


Re: start time is out mp4

2013-06-22 Thread Maxim Dounin
Hello!

On Sat, Jun 22, 2013 at 10:40:53AM +0100, Richard Kearsley wrote:

 Hi
 I’m using the mp4 module quite heavily, and very occasionally (once
 every minute or so on a busy website) there is an error written to
 error.log and status 500 returned in the access log
 
 [error] 42078#0: *5510811 start time is out mp4 stts samples in ...
 (mostly this error)
 [error] 42072#0: *5524976 start time is out mp4 stsc chunks in ...
 (sometimes this error)
 
 It happens on different videos and only when ?start is after a
 certain time point (different for each video)
 
 Given that the mp4 module works remarkably well on the whole, where
 should I look to find the cause of these rare errors? (and what do
 they actually mean :))

Messages suggest an attempt was made to seek to a time which isn't 
in media track metadata, thus seek isn't possible.  This usually 
happens when time in start= is just too big.

-- 
Maxim Dounin
http://nginx.org/en/donation.html

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

Re: start time is out mp4

2013-06-22 Thread Richard Kearsley

Hi
I've been able to test a few videos myself and can see it happening
Just to be clear, 99%+ seem to be fine and can seek right up to the end
But on very few, seeking is only possible up to X seconds (X could be at 
any point in the video)

To seek after X, the error always happens
However if I watch the video from start to end, it downloads the full 
thing and can be watched to the end (the file isn't truncated)


At this point I suppose it's either an error while creating the metadata 
at the encoder software, or some odd circumstance which nginx doesn't like

The question is, which?

Thanks


On 22/06/13 15:41, Maxim Dounin wrote:

Hello!

On Sat, Jun 22, 2013 at 10:40:53AM +0100, Richard Kearsley wrote:


Hi
I’m using the mp4 module quite heavily, and very occasionally (once
every minute or so on a busy website) there is an error written to
error.log and status 500 returned in the access log

[error] 42078#0: *5510811 start time is out mp4 stts samples in ...
(mostly this error)
[error] 42072#0: *5524976 start time is out mp4 stsc chunks in ...
(sometimes this error)

It happens on different videos and only when ?start is after a
certain time point (different for each video)

Given that the mp4 module works remarkably well on the whole, where
should I look to find the cause of these rare errors? (and what do
they actually mean :))

Messages suggest an attempt was made to seek to a time which isn't
in media track metadata, thus seek isn't possible.  This usually
happens when time in start= is just too big.



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

Re: start time is out mp4

2013-06-22 Thread Richard Kearsley

Hi
I'm pretty sure I have found the cause,
All the videos I see it happening on have short audio (Audio stops 
before the video)


On 22/06/13 16:06, Richard Kearsley wrote:

Hi
I've been able to test a few videos myself and can see it happening
Just to be clear, 99%+ seem to be fine and can seek right up to the end
But on very few, seeking is only possible up to X seconds (X could be 
at any point in the video)

To seek after X, the error always happens
However if I watch the video from start to end, it downloads the full 
thing and can be watched to the end (the file isn't truncated)


At this point I suppose it's either an error while creating the 
metadata at the encoder software, or some odd circumstance which nginx 
doesn't like

The question is, which?

Thanks


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


Re: No MIME types

2013-06-22 Thread Peleke
I have the same problem with other software (tested selfoss for example)
even if I want to set it up completely from scratch. 
How can I find the root problem and fix it?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,240262,240274#msg-240274

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


Using SNI to route proxy_pass to upstream SSL host

2013-06-22 Thread David Mohl
Hey guys,I am trying to get the following setup running:Nginx is listening to port 443. According to the users host (SNI), it should route the SSL requests to a upstream daemon / host which will take care of SSL certification, handshake and so on.Nginx should not touch the request, just pass it.Since SSL also encrypts the header, it makes this setup a little bit more difficult than expected. A hint on serverfault indicated that SNI might be useful for this?My current experiment:server { listen 443; server_name example01.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8001; } }server { listen 443; server_name example02.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8002; } }server { listen 443; server_name example03.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8003; } }server { listen 443; server_name example04.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8004; } }However, this doesn't seem to work.Any ideas on this?Cheers,David___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

bug in spdy - 499 response code on long running requests

2013-06-22 Thread justin
We sometimes have long running HTTPS requests, over 2 minutes, and
occasionally would see 499 response codes, and duplicate (double run)
transactions. After digging around and testing, it was discovered this only
occurs with spdy support enabled. If we turn off spdy in the server block,
the 499 response codes, and more  importunately duplicate transactions
stopped.

Is this a known limitation of spdy, or perhaps a bug? If this is a
limitation of spdy? Is it fixed in protocol version 3, since nginx only runs
version 2. Would love to turn spdy support back on, but I can't have
duplicate requests being fired.

Thanks.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,240278,240278#msg-240278

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