Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all 7229 articles
Browse latest View live

get some errors when i install openresty (no replies)

$
0
0
some errors:

x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/042-crc32.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/107-timer-errors.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/123-lua-path.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/127-uthread-kill.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/098-uthread-wait.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/026-mysql.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/052-sub-dfa.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/086-init-by.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/070-sha1.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/044-req-body.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/006-escape.t
x ngx_openresty-1.7.10.1/bundle/ngx_lua-0.9.15/t/093-uthread-spawn.t: (Empty error message)
tar: Error exit delayed from previous errors.

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

Case insensitive exact location match? (no replies)

$
0
0
I know how to do case insensitive regex location matching. But it would be
very useful if I could do same with exact string matching, something like

location =* /test

So it would matching "/test" as well as "/TEST"

Or some other way to convert case of the request string without
needing for regex engine?

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

DNS configuration to invoke complete URL (no replies)

$
0
0
Hi Talents,
Need your support immediately on the below requirement:

I have configure DNS "worsktream.com" to proxy pass the complete URL "http://worsktream.com/workstream/agentLogin"
while invoking the dns name following message is thrown:
- error 414 Request-URI Too Large

And after configuring following to fix the above issue
syntax: large_client_header_buffers number size
default: large_client_header_buffers 4 4k/8k

Now, the below issue is reported
- nginx accept() failed (24 too many open files)

I could see the logs are getting piled up with so many hits on the request URL. Indefinite loop is seen.

Please suggest to resolve this.

Best regards,
Maddy

Get some errors when i install openresty on mac (no replies)

$
0
0
I have some errors when i install openresty on mac:



Please help me. Thank you in advance._______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Get some errors when i install openresty on mac (no replies)

$
0
0
I have some errors when i install openresty on mac:

use command: tar xzvf ngx_openresty-1.7.10.1.tar.gz




Please help me. Thank you in advance._______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

swf problem with reverse proxy (no replies)

$
0
0
Hello,
I have a nginx reverse proxy behind nginx web server.
I have a simple flash site, with swf embedded in html page.

I have a problem with this page, swf start loading but does not end.
If I point site directly to web server, swf work correctly.
Can you help me ?

My reverse proxy settings is these:

location / {
proxy_pass http://Backend;
proxy_http_version 1.1;
proxy_cache STATIC;
proxy_set_header Host $host;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Cache-Status $upstream_cache_status;
proxy_ignore_headers Cache-Control;
proxy_no_cache $http_pragma $http_authorization $cookie_nocache $arg_nocache;
proxy_cache_bypass $http_pragma $http_authorization $cookie_nocache $arg_nocache;
proxy_cache_valid 403 1m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_cache_methods HEAD GET;
proxy_cache_key $host$request_uri$cookie_user;
}



Tnx
Manuel

Using diameter aaa protocol with nginx (no replies)

$
0
0
Hi,
I want to set up a AAA layer over the nginx server (for approxiamtely 2000
users at a time). I saw the available options, and found diameter and
tacacs+ to be the best. I found there's a PAM module/library for
implementing tacacs+ with nginx. Is there a similar module for Diameter as
it is more suitable for my requirements? If not what is the procedure to
integrate tacacs+ with nginx. I am using Ubuntu 14.04.

--
Yash Shrivastava
Second Year Undergraduate Student
Department of Computer Science and Engineering
IIT Kharagpur
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Allow all Access-Control-Allow-Headers (no replies)

$
0
0
Hi,

I have a nginx in front of many differrents web applications. At this time a have a generic configuration for all applications.
Now I need to allow all Access-Control-Allow-Headers but I did not find how to do this.

One of the web application behind my nginx reverse proxy set custom headers. At this time i create a specific nginx configuration file for this application with configuration :

if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'traceId,channel,callerId,version,type';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}

But I don't like this solution because I need to have a generic configuration for all web applications behind the nginx.

Is it possible to allow all "Access-Control-Allow-Headers" for all request ?

Thanks for your reply.

Regards.

Simple timeout module (3 replies)

$
0
0
I'm trying to build a simple timeout module using nginx timers. At the beginning of a request I'm firing up a timer and after time interval elapses I want to check if request has already completed, and if not, finalize it, for example it with NGX_HTTP_REQUEST_TIME_OUT. I have created a filter module. I'm creating a timer in filter headers:

static ngx_int_t simple_timeout_filter_headers(ngx_http_request_t* request)
{
ngx_event_t* timeout_event;

timeout_event = ngx_pcalloc(request->pool, sizeof(ngx_event_t));
if (timeout_event == NULL)
{
return NGX_ERROR;
}

timeout_event->handler = simple_timeout_handler;
timeout_event->data = request;
timeout_event->log = request->connection->log;

ngx_log_debug0(NGX_LOG_DEBUG_HTTP, request->connection->log, 0,
"SIMPLE TIMEOUT TIMER START");

ngx_add_timer(timeout_event, 3000); /* wait for 3 seconds */

return next_header_filter(request);
}

Simple timeout handler looks like this:

static void simple_timeout_handler(ngx_event_t* timeout_event)
{
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, timeout_event->log, 0,
"SIMPLE TIMEOUT TIMER END");
}

And it works if I issue a request, and wait for a timer to fire. If I issue several requests while the previous timer is already in progress, I get a SEGFAULT.

A SEGFAULT happens here, while inserting a node into rbtree:

ngx_rbtree_insert() at ngx_rbtree.c:32 0x40d3c0
ngx_event_add_timer() at ngx_event_timer.h:84 0x42fc32
ngx_http_init_connection() at ngx_http_request.c:363 0x42fc32
ngx_event_accept() at ngx_event_accept.c:360 0x41c9ec
ngx_epoll_process_events() at ngx_epoll_module.c:822 0x424a00
ngx_process_events_and_timers() at ngx_event.c:248 0x41bb2c
ngx_single_process_cycle() at ngx_process_cycle.c:308 0x423c8b
main() at nginx.c:416 0x403bc6


So what I'm missing in my simple_timeout_filter_headers method?

Nginx version 1.8

is it possible to use multiple sub_filter in one location? (1 reply)

$
0
0
Trying to do this:

location /whatever/ {
proxy_buffering off;
proxy_pass http://11.22.33.44:5555;
sub_filter '"df":"https://df-foo"' '"df":"https://df-bar"';
sub_filter '"pr":"https://pr-foo"' '"pr":"https://pr-bar"';
sub_filter_once off;
sub_filter_types *;
}

But I'm getting this:

nginx: [emerg] "sub_filter" directive is duplicate in ...

How do I replace multiple things in one location?

Thanks.

--
Florin Andrei
http://florin.myip.org/

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

Stable Ubuntu PPA (no replies)

$
0
0
Hi

I have recently upgraded our fleet of Ubuntu servers to nginx 1.8.0
via the nginx/stable PPA[1]. After the upgrade we are seeing two -
probably related - problems. They are:

1. When the log files are rotated by logrotate(8) nginx doesn't start
writing to the new log files until it's reloaded, restarted or has
been "/etc/init.d/nginx rotate"'ed.

2. The ulimit setting for number of open files specified inside
/etc/default/nginx no longer takes effect.


The first bug I debugged being down to the "invoke-rc.d nginx rotate
>/dev/null 2>&1" command being ran after the log is rotated. I tried
running the command manually and the output doesn't look very
promising:

$ sudo invoke-rc.d nginx rotate
initctl: invalid command: rotate
Try `initctl --help' for more information.
invoke-rc.d: initscript nginx, action "rotate" failed.

I worked around that issue with replacing "invoke-rc.d" inside
/etc/logrotate.d/nginx with "service", and since then the logs has
been rotated correctly.


When debugging the second problem, I found out that the 1.8.0 version
of the nginx-common package - besides the init.d script - also
includes an Upstart configuration. I don't know why both types of
service scripts are included in the configuration, because it
introduces a couple of problems:

- On boot up it's a race between if nginx is started by Upstart or by
the init.d script - Upstart seems to win most of the times from what I
have seen.
- The Upstart configuration doesn't support the "rotate" call, which
is causing invoke-rc.d to fail in the log rotation configuration,
since it prefers to call an Upstart service rather than an init.d
script.
- /etc/default/nginx is no longer used by the Upstart configuration,
possibly causing big problems for people (like me) who had to increase
the limit of number of files descriptors nginx is allowed to have
open.


As a test I started up an EC2 machine based on an image which has the
nginx-common 1.6.3-1+trusty0 package installed. The machine only has
an init.d script for nginx and thus nginx is started through that.
I then upgraded nginx on the machine and got it to nginx-common
1.8.0-1+trusty1. After the upgrade nginx was still started through the
init.d script, and thus any changes in /etc/default/nginx would have
been applied. Log rotation will however not work at this stage, since
the Upstart script means invoke-rc.d in the log rotation configuration
will fail to send a USR1 signal to nginx.
The frightening thing is then, when the machine is rebooted and nginx
the next time is started by Upstart, the changes make to
/etc/default/nginx no longer applies, but it can be difficult to spot
as nginx otherwise start up normally.

I think this is a pretty bad problem and something that should be
fixed sooner rather than later. I don't really care if we go for
Upstart or init.d, as long as there's only one way to do it and there
aren't files included with the package that may lead you to think it
works in another way.


[1]: https://launchpad.net/~nginx/+archive/ubuntu/stable

--
Jeppe Toustrup

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

a problem while using nginx1.4.6 and nginx1.8.0 for web service (1 reply)

$
0
0
Hello,


This is Amily.
I meet a problem while using nginx1.4.6 and nginx1.8.0 for web service.


The follow is that the content shows on the /var/log/messages:
May 21 01:55:51 web3 kernel: nginx[16176] general protection ip:3acd289713 sp:7fff98d6aba8 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 01:56:01 web3 kernel: nginx[20064] general protection ip:3acd289713 sp:7fff98d6ac08 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 01:56:02 web3 kernel: nginx[16174] general protection ip:3acd289713 sp:7fff98d6aba8 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 01:56:07 web3 kernel: nginx[16195] general protection ip:3acd279753 sp:7fff98d6ac20 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 01:56:07 web3 kernel: nginx[5326] general protection ip:3acd289713 sp:7fff98d6ac08 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 02:49:41 web3 kernel: nginx[16192] general protection ip:4129bc sp:7fff98d6ada0 error:0 in nginx[400000+9c000]
May 21 02:49:42 web3 kernel: nginx[16188]: segfault at 0 ip 0000003acd27b55c sp 00007fff98d69d88 error 4 in libc-2.12.so[3acd200000+18a000]
May 21 02:49:48 web3 kernel: nginx[712] general protection ip:3acd289713 sp:7fff98d6ac08 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 02:50:19 web3 kernel: nginx[2847] general protection ip:3acd289713 sp:7fff98d6ac08 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 02:50:19 web3 kernel: nginx[2872] general protection ip:3acd279753 sp:7fff98d6ac80 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 02:50:34 web3 kernel: nginx[3494] general protection ip:4129bc sp:7fff98d6adc0 error:0 in nginx[400000+9c000]
May 21 02:50:34 web3 kernel: nginx[18681] general protection ip:3acd289713 sp:7fff98d6ac08 error:0 in libc-2.12.so[3acd200000+18a000]
May 21 04:47:25 web3 kernel: nginx[10306] general protection ip:4129bc sp:7fff98d6ada0 error:0 in nginx[400000+9c000]




And the follow content is the error showing in the nginx.error.log:


*** glibc detected *** nginx: worker process: free(): invalid next size (normal): 0x0000000000c9e9d0 ***
*** glibc detected *** nginx: worker process: munmap_chunk(): invalid pointer: 0x0000000001568f80 ***
*** glibc detected *** nginx: worker process: corrupted double-linked list: 0x000000000173cf80 ***
*** glibc detected *** nginx: worker process: double free or corruption (!prev): 0x0000000001a66990 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3acd275e66]
/lib64/libc.so.6[0x3acd2789b3]
nginx: worker process(ngx_destroy_pool+0xdb)[0x40dec1]
nginx: worker process(ngx_http_free_request+0x1aa)[0x436934]
nginx: worker process[0x4369df]
nginx: worker process[0x437b92]
nginx: worker process(ngx_event_process_posted+0x87)[0x422de9]
nginx: worker process(ngx_process_events_and_timers+0x166)[0x422c0b]
nginx: worker process[0x4299d0]
nginx: worker process(ngx_spawn_process+0x485)[0x42815c]
nginx: worker process(ngx_master_process_cycle+0x566)[0x42a3e9]
nginx: worker process(main+0xa0b)[0x40d2cd]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3acd21ed5d]
nginx: worker process[0x40ba99]
======= Memory map: ========
00400000-00491000 r-xp 00000000 08:03 1182281 /opt/nginx/sbin/nginx
00691000-006a0000 rw-p 00091000 08:03 1182281 /opt/nginx/sbin/nginx
006a0000-006af000 rw-p 00000000 00:00 0
01373000-014c4000 rw-p 00000000 00:00 0
014c4000-01ed8000 rw-p 00000000 00:00 0
3acce00000-3acce20000 r-xp 00000000 08:03 204694 /lib64/ld-2.12.so
3acd01f000-3acd020000 r--p 0001f000 08:03 204694 /lib64/ld-2.12.so
3acd020000-3acd021000 rw-p 00020000 08:03 204694 /lib64/ld-2.12.so



The attach file is the details about nginx error log while the website is running .
Please help me to make sure whether it is something wrong about nginx. I will be appreciated with your generous help.
Thanks


Best Regards,
Amliy_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Best place for metrics module (1 reply)

$
0
0
I want to write my custom nginx module for measuring request processing time for every HTTP request received. I need to start counting request processing time as early as nginx receives first byte of a request and finish, when it sends the last byte in a response. What would the best place be in nginx request processing pipeline to plug in my module and these measuring hooks?

Cancel ongoing ngx_http_request_t (no replies)

$
0
0
So I'm continuing to work on my simple timeout module: http://forum.nginx.org/read.php?2,259019

Now, when timer elapses, I want to cancel ongoing http request, here's my timer handler:

static void simple_timeout_handler(ngx_event_t* timeout_event)
{
ngx_http_request_t* request = (ngx_http_request_t*)timeout_event->data;

ngx_log_debug0(NGX_LOG_DEBUG_HTTP, timeout_event->log, 0,
"SIMPLE TIMEOUT TIMER END");

ngx_http_finalize_request(request, NGX_HTTP_REQUEST_TIME_OUT); // this does not seem to work,
// as request stays in progress
}

This does not work as request still continues to be in progress. Is it possible to terminate it immediately, and return http timeout response?

ip_hash in active_active nginx setup (2 replies)

$
0
0
Hi all,

we want to use a F5 loadbalancer in front of two nginx instances, which balance the load to our app-nodes.

The F5 loadbalancer distributes incoming requests via round-robin algorithm to the two nginx instances.

The nginx instances should be configured to use ip_hash to distribute the requests to the addnodes ensuring sticky sessions. Specific customer requirements make the use of cookies to ensure sticky sessions impossible.

I understand, that all nginx instances use the same function to hash the IP adress. But i am not sure if the distribution of the hash values to the appnodes happens in a consistent way.

I came across the following discussion on github which indicates that the same IP address may be forwarded to different appnodes in the scenario described above:

http://serverfault.com/questions/511763/do-multiple-nginx-servers-load-balance-the-same-ip-address-to-the-same-backend-w

Long story short / tl;dr:

Will different nginx instances forward requests from the same IP always to the same appnode when using ip_hash as a load balancing method?

Thanks,

htaccess to nginx conversion? (no replies)

$
0
0
Hello,

I am working with a panel in which requires the pages to function properly from the .htaccess file. However, I am no longer using Apache and have decided to do a Centmin Mod LEMP web stack to improve performance and whatnot. Anyways, I used this online converter http://winginx.com/en/htaccess and when I put the code it gave me into my vhost.conf file, I got an error (see below). The error occurs even when I place that code in my domain.com.conf file, vhost.conf file, or nginx.conf file. The URL types my panel uses are http://domain.com/staff/core.staffDetails and it's throwing a 404 error simply because it's not reading the .htaccess file since I'm using Nginx.

The error I'm receiving:

--
[root@radio ~]# ngxrestart
nginx: [emerg] "location" directive is not allowed here in /usr/local/nginx/conf/conf.d/virtual.conf:50
--

Again, that happens even when I try the other files listed above.

.htaccess code I need converted:

--
Options -Indexes

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico

RewriteRule ^(.*)(\.)(.*)$ index.php?url=$1.$3 [L,QSA]
RewriteRule ^ajax$ _res/ajax.php [QSA]
#RewriteRule ^(.*)$ index.php?t=$1 [L,QSA]
</IfModule>
---

I am using a Linux VPS running CentOS 6.5 if that information is needed.

Thank you!

ssl_dhparam compatibility issues? (3 replies)

$
0
0
I'm using Mozilla's "Old backward compatibility" ssl_ciphers so I feel
good about my compatibility there, but does the following open me up
to potential compatibility problems:

# openssl dhparam -out dhparams.pem 2048

nginx.conf:
ssl_dhparam {path to dhparams.pem}

https://wiki.mozilla.org/Security/Server_Side_TLS

- Grant

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

encoded url (1 reply)

$
0
0
Hello everyone,
I've nginx 1.2.5 and I've an issue about encoded URLs.
Is there a way to make nginx accepts URL like the following:


http://www.mywebsite.com/image.php%3Fid%3D12345

as equivalent of the following?

http://www.mywebsite.com/image.php?id=12345



In my current configuration, the first URL is 404 not found, and the second one works.

Many thanks

PB

can somebody help me to rewrite this? (3 replies)

$
0
0
Hi guys, i really need some help here. I plan to move my forum from the root domain to a subfolder named "/forum"

I need to rewrite from:
www.mywebsite.com/showthread.php?t=123456

To

www.mywebsite.com/forum/showthread.php?t=123456

I hope you guys can help me to find out the rewrite rules.
Thank you!

calling unique url not more then 1 time per 5 seconds (3 replies)

$
0
0
Hi,

Assuming I have an url like /payout/[hash] , where hash is something unique, and I want to make, that on nginx level it's checked that this url is called not more then 1 time per 5 seconds. 1st time it should be processed by proxy_pass, all the other times it should be replied 403.

Could someone tell me which approach I should use? Is that possible to do that using nginx?

Any thoughts are appreciated.

Regards,
Viewing all 7229 articles
Browse latest View live


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