Thanks. And I want to know the time when "proxy_set_header" is executed, because the my cookie value is related to the chosen upstream server. So will proxy_set_header happen before upstream peer initialization or after that?by speedfirst - Nginx Mailing List - English
Hey, I want to add custom cookie when proxy pass to the upstream in my custom module. I want to implement like what this config does: proxy_pass http://servers; proxy_add_header Cookie "$http_cookie;KEY=VALUE"; But sinc the VALUE is dynamically generated so I need to add this cookie via programming. How to do that? Thanks very much.by speedfirst - Nginx Mailing List - English
is this OK? r->headers_out.status = NGX_HTTP_REDIRECT; r->headers_out.content_length_n = 0; ... // the code set "Location" header ngx_http_send_header(r);by speedfirst - Nginx Mailing List - English
Hey, I'm making a custom module and need to send back the redirect response to the client. It should behave like the "sendRedirect" in java servlet programming. So which function is that API? Thanks.by speedfirst - Nginx Mailing List - English
sorry, ignore the last pst.by speedfirst - Nginx Mailing List - English
So how to do that? Thanks.by speedfirst - Nginx Mailing List - English
Is direct pass OK, like this? proxy_pass https://servers?abc=1by speedfirst - Nginx Mailing List - English
Hey, I wanna add a custom arg to the upstreams by proxy_pass like this: upstream servers { server1:8011; server2:8012; } ... server { listen on 8443; ssl on; server_name server0; location / { proxy_pass https://servers; } } My expectation: type "https://server0:8443" and the upstream will get "https://server1:8011?abc=1" So howby speedfirst - Nginx Mailing List - English
I have this requirement. I want to use nginx as the reverse proxy, which listen on address A and forward the request to the backend server with address B. However, if B is down, I want the request to be sent to address C. The question is, address B is https and address C is http. But for the argument of proxy_pass module, I can only write one prefix (either "http" or "https").by speedfirst - Nginx Mailing List - English
Here is a new diff. I remove most unrelated changes. Please review it. I very hope to merge this in the main branch so please give the detailed suggestions. For the style problems, do u have any guide or doc for that? I can't precisely guess the style from the existing code. Many thanks. --- nginx-0.9.5/src/core/ngx_inet.c 2011-02-17 07:01:16.000000000 -0800 +++ nginx-0.9.5/src/core/ngx_inetby speedfirst - Nginx Development
Thanks for the comments. I have several questions: 1. You mentioned "style problems". What exactly are they? The web page of mail list will trim the spaces/tabs so it's hard to judge the problem. Last time, you commented my code that there should be no space between the function name and "(", that's clear. I want the suggestions like that. 2. You mentioned "It's not cleby speedfirst - Nginx Development
--- nginx-0.9.5/src/core/ngx_inet.c 2011-02-17 07:01:16.000000000 -0800 +++ nginx-0.9.5/src/core/ngx_inet2.c 2011-03-02 05:48:53.737646990 -0800 @@ -826,7 +826,11 @@ if (*port == ':') { port++; - len = last - port; + if (uri) { + len = uri - port; + } else { + len = last - port; + }by speedfirst - Nginx Development
Thanks for the comments. I have several questions: 1. You mentioned "style problems". What exactly are they? The web page of mail list will trim the spaces/tabs so it's hard to judge the problem. Last time, you commented my code that there should be no space between the function name and "(", that's clear. I want the suggestions like that. 2. You mentioned "It's not cleby speedfirst - Nginx Development
I submit a patch with the diff in the attachment. Is it received or accepted for the main branch? I'm a new developer here and not familiar with the rules. Sorry for the native question. The patch is in http://forum.nginx.org/read.php?29,179636by speedfirst - Nginx Mailing List - English
sorry, the diff file in the last file is bad, use this one. This is a new implementation according to your comments. Here is my comments to this patch 1. ngx_inet_sock_addr is removed. You are right, ngx_parse_url can do that job. So no need to change ngx_inet.h 2. the old "gethostbyname" implementation will be used if "--with-ipv6" is not set; when "--with-ipv6"by speedfirst - Nginx Development
This is a new implementation according to your comments. Here is my comments to this patch 1. ngx_inet_sock_addr is removed. You are right, ngx_parse_url can do that job. So no need to change ngx_inet.h 2. the old "gethostbyname" implementation will be used if "--with-ipv6" is not set; when "--with-ipv6" is set, "getaddrinfo" will be used 3. now when &quby speedfirst - Nginx Development
Two files are affected "ngx_inet.c" and "ngx_inet.h". I remove the original "ngx_parse_inet_url" and "ngx_parse_inet6_url" because they have many duplicated code and "ngx_pare_inet_url" this name won't describe what it does comprehensively (it may generate IPv6 too). So I use "ngx_parse_url" to split the url to "host", "poby speedfirst - Nginx Development
I think this way would be better: #if (NGX_HAVE_UNIX_DOMAIN) #define NGX_SOCKADDRLEN sizeof(struct sockaddr_un) #else #define NGX_SOCKADDRLEN sizeof(struct sockaddr_storage) #endif sizeof(sturct sockaddr_storage) is 128 in my Linux 64bit, 512 is too big. anyway, this is not critical.by speedfirst - Nginx Mailing List - English
For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set NGX_SOCKADDRLEN 512?by speedfirst - Nginx Mailing List - English
what I mean is, in Web, nginx-devel@ is readonly. And after I send mail, my message doesn't show in the list. Is it alright?by speedfirst - Nginx Mailing List - English
never try to use a mail list before. I try to send the diff to nginx-devel@nginx.org through email. Is that OK? sorry this is naive.by speedfirst - Nginx Mailing List - English
Hey, guys. I've implement a parse URL to IPv6 function which is discussed in "http://forum.nginx.org/read.php?2,177146,177190". I change "ngx_parse_url" and add an function "ngx_parse_host" to resolve a host (IP or text) to either IPv4 or IPv6 functions. And I change "ngx_inet_resolve_host" to let it accept IPv4/IPv6. Besides I add another function "ngxby speedfirst - Nginx Mailing List - English
If I only concern about the proxy of http upstream and mail upstream, is it alright to change the implementation of "ngx_parse_url", which replace "gethostbyname" to "getaddrinfo"? Is there other issues that I need to pay attention?by speedfirst - Nginx Mailing List - English
I check the code and find it uses "ngx_parse_url" and this function first try to find whether there is a "[" in the first character to judge whether use ipv4 or ipv6 parse. This is clearly wrong because you can't tell the URL's ip address type. I'd like to write a patch to improve this.by speedfirst - Nginx Mailing List - English
I have several upstream servers, which are configured like this: upstream backend { ip_hash; server backend1.example.com; server backend2.example.com; server backend3.example.com down; server backend4.example.com; } each server has ONLY IPv6 address. But seems nginx can't parse it to that address, and report an error like this " host not found". Is thisby speedfirst - Nginx Mailing List - English
Hey I'm a developer of Zimbra and responsible of Nginx-Zimbra Extension. Zimbra have some mail related code to contribute, for example mail SASL authentication, IMAP ID command suport, etc... If u are interested, contact me via jiankuan@zimbra.com. We can talk in more details.by speedfirst - Nginx Mailing List - English
In ngx_inet.c, there is a code piece of function "ngx_inet_resolve_host". If I set u->one_addr to 1, but unfortunately this hostname map to multiple IP addresses, such as 10.37.4.92 myhost 127.0.0.1 myhost in /etc/hosts. h->h_addr_list will be 2 entries before NULL. Each of them will be converted to human readable format and assigned to u->addrs[ i ]. However, whenby speedfirst - Nginx Mailing List - English
When I set "user user1;" in config and use sudo to start nginx, all worker processes are owned by "user1", only master process are owned by "root". With these, I can't create a Linux account with proper permission setting for only nginx.by speedfirst - Nginx Mailing List - English
Yes, I just want dev and prodcution mode behave sameby speedfirst - Nginx Mailing List - English
Hey, I find when I set daemon off and master_process off to enter the dev single process mode, env simply doesn't work. My custom module depending on that env can't find them. So I check the code and find in ngx_single_process_cycle, ngx_set_environment is not invoked. So I add it like fellow code. Maybe u can fix this little bug in your main nginx branch. void ngx_single_process_cycle(ngx_cby speedfirst - Nginx Mailing List - English