rewrite with regex to use proxy_pass

2017-06-29 Thread Alexandre
Hello, I have a question, I wish I could parser a url and retrieve fields to inject them to another server. However, I can not. Here is my test: URL : http://mywebsite.net/folder1/folder2/hit.php?s=1&s2=&p=home::index&x2=[box]&apvr=[5.0]&idclient=&na=&ref= location ~ ^/folder1/folder2/ {

XSLT Error - parser error : Document is empty

2017-06-29 Thread webeau
I have been using the same XSLT files and proxy to an xml document for several generations without any problem. Recently (~1.11) I am getting an error when I do 'nginx -t': /etc/nginx/xsl/so.xslt:1: parser error : Document is empty error xsltParseStylesheetFile : cannot parse /etc/nginx/xsl/so.xs

Re: Strange issue after nginx update

2017-06-29 Thread Richard Stanway
Have you enabled the slowlog and request_slowlog_timeout directives in the php-fpm pool that this request is going to? These may provide a hint as to where the problem lies. On Fri, Jun 30, 2017 at 1:46 AM, Andrea Soracchi wrote: > Hi Richard, > > I have the same problem with fastcgi_request_buf

Re: Nginx redirect quey string to url

2017-06-29 Thread AjaySawant
Thanks Richard for replying but somehow this is not working. I see it is being redirected to http://www.example.com/fhu but not to http://www.example.com/fhu/foo and http://www.example.com/fhu/bar. As you mentioned I have matched the case exactly. Posted at Nginx Forum: https://forum.nginx.org/re

Re: Strange issue after nginx update

2017-06-29 Thread Andrea Soracchi
Hi Richard, I have the same problem with fastcgi_request_buffering[1] set to off: *21 http read client request body 2017/06/30 01:33:54 [debug] 19140#19140: *21 recv: fd:11 -1 of 1744 2017/06/30 01:33:54 [debug] 19140#19140: *21 recv() not ready (11: Resource temporarily unavailable) 2017/0

Re: Nginx redirect quey string to url

2017-06-29 Thread Richard Stanway
rewrite and location matching do not include query strings. As a quick workaround, I believe you could do something like this: if ($request_uri = "/abc/xyz/def.php?Id=13") { return 301 " http://www.example.com/fhu/foo";; } Be aware that this matches the request exactly - query string parameters m

Nginx redirect quey string to url

2017-06-29 Thread AjaySawant
I am trying to redirect a query string to url and I am using like this but it is somehow not working. Can somebody help? rewrite ^/abc/xyz/def.php?Id=13 http://www.example.com/fhu/foo permanent; rewrite ^/abc/xyz/def.php?Id=14 http://www.example.com/fhu/bar permanent; Posted at Nginx Forum: http

Re: Measuring nginx's efficiency

2017-06-29 Thread lists
Simply to reduce the attack surface, I would not use PHP if all that is served is static pages.  If you are just serving static pages, you may be able to reduce your verbs to "head" and "get". That is avoid "post." Again attack surface reduction. I put PHP in a "map" search and it is a favorite

Re: Measuring nginx's efficiency

2017-06-29 Thread Lucas Rolff
> Well, this php-engine is built into apache itself Just because apache do have a built in PHP handler such as mod_dso doesn't mean it's actually used to serve static files ( I can tell you that the php engine is never hit if you serve static files) > Anyway, considering only this fact, such a

Re: Measuring nginx's efficiency

2017-06-29 Thread ST
> If your current apache configuration serves static files via the php engine, > then you're doing something very wrong. Well, this php-engine is built into apache itself... Anyway, considering only this fact, such a bad apache configuration should not be significantly slower than that of nginx?

Re: Measuring nginx's efficiency

2017-06-29 Thread Lucas Rolff
If your current apache configuration serves static files via the php engine, then you're doing something very wrong. You might or might not see any speed gain depending on your apache configuration, but you should see a big difference in the amount of resources used to serve traffic. As Valenti

Re: Measuring nginx's efficiency

2017-06-29 Thread ST
On Thu, 2017-06-29 at 16:16 +0300, Valentin V. Bartenev wrote: > On Thursday 29 June 2017 15:32:21 ST wrote: > > On Thu, 2017-06-29 at 15:09 +0300, Valentin V. Bartenev wrote: > > > On Thursday 29 June 2017 14:00:37 ST wrote: > > > > Hello, > > > > > > > > with your help I managed to configure ngi

Re: Strange issue after nginx update

2017-06-29 Thread Payam Chychi
set your worker_process to 1 and try again ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Strange issue after nginx update

2017-06-29 Thread Richard Stanway
If you want to stream the upload directly to your backend, you should consider fastcgi_request_buffering[1]. The problem is most likely with your PHP backend though, you should examine why it takes so long to process the request. [1] http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fast

Re: set_real_ip_from, real_ip_header directive in ngx_http_realip_module

2017-06-29 Thread Maxim Dounin
Hello! On Thu, Jun 29, 2017 at 09:08:40AM -0400, foxgab wrote: > if nginx is behind another proxy, that proxy set the X-Forwarded-for header > with the real client ip, and the configration of nginx is : > > location / { > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > real_ip_he

Re: Measuring nginx's efficiency

2017-06-29 Thread Valentin V. Bartenev
On Thursday 29 June 2017 15:32:21 ST wrote: > On Thu, 2017-06-29 at 15:09 +0300, Valentin V. Bartenev wrote: > > On Thursday 29 June 2017 14:00:37 ST wrote: > > > Hello, > > > > > > with your help I managed to configure nginx and our website now can be > > > accessed both - through apache and ngin

Re: set_real_ip_from, real_ip_header directive in ngx_http_realip_module

2017-06-29 Thread foxgab
if nginx is behind another proxy, that proxy set the X-Forwarded-for header with the real client ip, and the configration of nginx is : location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; real_ip_headerX-Forwarded-For; set_real_ip_from 192.168.0.0/16; } whether the real

Re: Measuring nginx's efficiency

2017-06-29 Thread ST
On Thu, 2017-06-29 at 15:09 +0300, Valentin V. Bartenev wrote: > On Thursday 29 June 2017 14:00:37 ST wrote: > > Hello, > > > > with your help I managed to configure nginx and our website now can be > > accessed both - through apache and nginx. > > > > Now, how can I prove to my boss that nginx i

Re: Measuring nginx's efficiency

2017-06-29 Thread Valentin V. Bartenev
On Thursday 29 June 2017 14:00:37 ST wrote: > Hello, > > with your help I managed to configure nginx and our website now can be > accessed both - through apache and nginx. > > Now, how can I prove to my boss that nginx is more efficient than apache > to switch to it? How do I measure its performa

Measuring nginx's efficiency

2017-06-29 Thread ST
Hello, with your help I managed to configure nginx and our website now can be accessed both - through apache and nginx. Now, how can I prove to my boss that nginx is more efficient than apache to switch to it? How do I measure its performance and compare it to that of apache? Which tools would yo

Re: Strange issue after nginx update

2017-06-29 Thread Andrea Soracchi
Hi Payam, the problem is between Nginx and Php-fpm, but I have set the debug level log to nginx and php-fpm. Nginx: 2017/06/29 10:05:14 [warn] 5252#5252: *1613 a client request body is buffered to a temporary file /var/lib/nginx/body/44, client: 192.168.18.18, server: andrea.eorap