Re: Custom HTTP protocol response?

2024-06-15 Thread J Carter
Hello, On Thu, 13 Jun 2024 16:05:18 +0100 Kirill A. Korinsky wrote: > On Mon, 10 Jun 2024 09:56:05 +0100, > Martin Kjær Jørgensen via nginx wrote: > > > > > > Is this possible without hacking nginx sources or manipulative intermediate > > proxies? > > > > As you may see in ngx_http_header_f

Re: Custom HTTP protocol response?

2024-06-13 Thread Kirill A . Korinsky
On Mon, 10 Jun 2024 09:56:05 +0100, Martin Kjær Jørgensen via nginx wrote: > > > Is this possible without hacking nginx sources or manipulative intermediate > proxies? > As you may see in ngx_http_header_filter_module.c such string is hardcoded. -- wbr, Kirill ___

Re: Custom redirect for one page from https to http with different name.

2024-01-09 Thread Francis Daly
On Mon, Jan 08, 2024 at 02:22:14PM -0500, James Read wrote: Hi there, > how would I redirect https://example.com/oldname.php to > http://example.com/newname.php Within the https server{} block: location = /oldname.php { return 301 http://example.com/newname.php; } should do it. (Other 30x

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-21 Thread Dan G. Switzer, II
No, the 404 works as expected, the 413 does not. I’ll try building from source some time early next week to see if that fixes things. -Dan Sent from my iPhone > On Oct 20, 2022, at 7:49 PM, Sergey A. Osokin wrote: > > On Thu, Oct 20, 2022 at 04:25:33PM -0400, Dan G. Switzer, II wrote: >>

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Sergey A. Osokin
On Thu, Oct 20, 2022 at 04:25:33PM -0400, Dan G. Switzer, II wrote: > Sorry, that was a typo from the tweak to the real file names. The file > extensions matched in my test and I got the custom 404 error page. Dan, follow that everything works fine, could you confirm. Thank you. -- Sergey A.

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Dan G. Switzer, II
Sorry, that was a typo from the tweak to the real file names. The file extensions matched in my test and I got the custom 404 error page. On 10/20/2022 4:22 PM, Frank Swasey wrote: You do realize you redirected to .htm and specified .html in the location, right? On Thu, Oct 20, 2022 at 14:0

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Frank Swasey
You do realize you redirected to .htm and specified .html in the location, right? On Thu, Oct 20, 2022 at 14:02 Dan G. Switzer, II wrote: > Sergey, > > Thanks for taking the time to respond. That's not working for me. I tried > the following: > > > server { > listen 80; > > client_max_

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Sergey A. Osokin
On Thu, Oct 20, 2022 at 02:01:44PM -0400, Dan G. Switzer, II wrote: > Thanks for taking the time to respond. That's not working for me. I > tried the following: [...] > The 404 works fine, but sending more than 10k to the request still > returns the default nginx page. [...] > Is there a good

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Dan G. Switzer, II
Sergey, Thanks for taking the time to respond. That's not working for me. I tried the following: server {     listen 80;     client_max_body_size 10k;     error_page 403 =404 /404_status_code.htm;     error_page 404 =404 /404_status_code.htm;     error_page 413 =413 /413_status_code.htm;   

Re: Custom 413 error pages when client_max_body_size exceeded

2022-10-20 Thread Sergey A. Osokin
Hi Dan, thanks for the report. On Thu, Oct 20, 2022 at 09:04:31AM -0400, Dan G. Switzer, II wrote: > I'm using nginx/1.20.1 under CentOS Linux release 7.9.2009 (Core) and I > cannot get a custom error page to show when the client_max_body_size > limit has been exceeded. The browser will only re

Re: Custom

2021-09-15 Thread Francis Daly
On Tue, Sep 14, 2021 at 05:04:43PM +, Mohit Joshi wrote: Hi there, >Looking for a custom configuration block for my module, since this needs > to be applied to all servers so wanted to block inside http as in > MY_MODULE_CONFIGURATION below. I suspect that you will find more examples

Re: custom 502 error for stacked proxies

2019-05-03 Thread Paul B. Henson
On Fri, May 03, 2019 at 01:47:40PM +0300, Sergey Kandaurov wrote: > you may want to try recursive error pages in location / {} > with error_page 502 in @server_b. Sweet, that did indeed do the trick. Thank you very much for the suggestion. ___ nginx ma

Re: custom 502 error for stacked proxies

2019-05-03 Thread Sergey Kandaurov
> On 3 May 2019, at 03:52, Paul B. Henson wrote: > > So, I've got a need for a reverse proxy where first it tries server A; > if it gets a 404 from server A it should try server B, and then just > return whatever happens with server B. > > I've got this config so far: > > location /_nginx_/

Re: Custom HTTP code in limit_except

2018-08-13 Thread 5lava
Bump Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280084,280867#msg-280867 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: custom log_format not inherited by server block

2018-05-18 Thread Maxim Dounin
Hello! On Thu, May 17, 2018 at 11:03:08PM +0100, Pete Cooper wrote: > I am compiling Nginx 1.14.0 from source on Ubuntu 18.04 LTS with > a view to compiling ipscrub as a dynamic module. > > My compile completes without error, my nginx.conf validates, > Nginx runs as expected, yet my server bl

Re: Custom error_page

2018-05-14 Thread Friscia, Michael
Ok, I kind of found the answer here http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors then I realized my problem is that I only want to do this for 500,502,503 and 504, I want the upstream server to handle 404 errors on its own. So is there a way to only intercept t

Re: custom ip address on port 80 not listening

2017-04-08 Thread Francis Daly
On Sat, Apr 08, 2017 at 08:46:57AM +0100, Musta Fa wrote: Hi there, > but i can not make it listen on custom_ip:80 > port 80 is always 0.0.0.0:80 > > cd /etc/nginx > grep listen -r * > only "listen custom_ip:80;" > > why is that?? Any server{} without an explicit "listen" has an implicit "list

Re: custom logic after connection is closed

2016-11-14 Thread nemster
Hi Maxim, Maxim Dounin Wrote: --- > Hello! > > On Mon, Nov 14, 2016 at 05:08:33AM -0500, nemster wrote: > > > Hi! > > Is it possible to write a plugin that does some additional stuff > after a TLS > > (http/1.1, http/2.0) TCP connection. > > I

Re: custom logic after connection is closed

2016-11-14 Thread Maxim Dounin
Hello! On Mon, Nov 14, 2016 at 05:08:33AM -0500, nemster wrote: > Hi! > Is it possible to write a plugin that does some additional stuff after a TLS > (http/1.1, http/2.0) TCP connection. > I would want to keep some extra struct for each TLS connection and > manipulated it with every request, th

Re: Custom Module Directive is Duplicate? Error in conf?

2015-11-02 Thread de_nginx_noob
I understand now. Thank You! Posted at Nginx Forum: https://forum.nginx.org/read.php?2,262425,262566#msg-262566 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Custom Module Directive is Duplicate? Error in conf?

2015-10-23 Thread Maxim Dounin
Hello! On Fri, Oct 23, 2015 at 10:01:34AM -0400, de_nginx_noob wrote: > After compiling a test module that sets a variable equal to "test > successful", I get a "directive is duplicate in (path to conf file)" [...] > conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_netacuity_conf_t)); >

Re: Custom Module Directive is Duplicate? Error in conf?

2015-10-23 Thread de_nginx_noob
Tried setting featureCode in the create_conf function to -1 and somehow that fixed it? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,262425,262426#msg-262426 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/n

Re: Custom error pages and access_log inheritance

2015-10-02 Thread Francis Daly
On Fri, Oct 02, 2015 at 07:30:28AM -0400, bjoe2k4 wrote: Hi there, > i was wondering if it is possible to have custom error pages *without* the > error page locations inheriting the http or server level access_log > directives. Requests are logged in the context of a location where processing en

Re: Custom settings with PHP

2015-01-20 Thread locojohn
Hello Maxim, Maxim Dounin Wrote: --- > As already replied in russian list, currently (going to be fixed) > this may be done only with a hack like > > geo $x { > default "${include_path}:/my/other/include/path"; > } > > fas

Re: Custom compilation flag for an nginx module

2014-12-04 Thread erankor2
Thanks Maxim, that's very helpful, it works great Eran Posted at Nginx Forum: http://forum.nginx.org/read.php?2,255292,255302#msg-255302 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Custom compilation flag for an nginx module

2014-12-03 Thread Maxim Dounin
Hello! On Wed, Dec 03, 2014 at 11:28:28AM -0500, erankor2 wrote: > Thank you Maxim, your suggestion will definitely work for me. > > Are you familiar with any simple "non-core" module that does it ? I will > need to test for the existence of this function or the need to explicitly > add librt, a

Re: Custom compilation flag for an nginx module

2014-12-03 Thread erankor2
Thank you Maxim, your suggestion will definitely work for me. Are you familiar with any simple "non-core" module that does it ? I will need to test for the existence of this function or the need to explicitly add librt, and update CORE_LIBS accordingly + define some preprocessor macro that I can l

Re: Custom compilation flag for an nginx module

2014-12-03 Thread Maxim Dounin
Hello! On Wed, Dec 03, 2014 at 10:47:01AM -0500, erankor2 wrote: > Hi all, > > Is it possible for an nginx module to define custom compilation switches > that add external libs / preprocessor macros ? Is there some example of a > module that does it ? No. > Specifically, what I'm trying to do

Re: custom error pages for retun directive

2014-08-26 Thread kay
Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252825,252880#msg-252880 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: custom error pages for retun directive

2014-08-26 Thread Maxim Dounin
Hello! On Tue, Aug 26, 2014 at 08:41:31AM -0400, kay wrote: > How can "if in location" influence productivity? There is no difference from performance point of view. -- Maxim Dounin http://nginx.org/ ___ nginx mailing list nginx@nginx.org http://mai

Re: custom error pages for retun directive

2014-08-26 Thread kay
How can "if in location" influence productivity? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252825,252844#msg-252844 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: custom error pages for retun directive

2014-08-26 Thread Maxim Dounin
Hello! On Tue, Aug 26, 2014 at 04:48:41AM -0400, kay wrote: > It is not possible to set custom error page. For example > /usr/share/nginx/404.html contains "test": > > server { > error_page 404 /404.html; > > if ($request_method = "GET") > return 404; > } > > location / { > proxy_pass http://

Re: Custom error page for post queries

2014-08-11 Thread Maxim Dounin
Hello! On Mon, Aug 11, 2014 at 03:39:40AM -0400, Keferoff wrote: > Hi! > > Current infrastructure: > We have nginx/1.7.1 as frontend for java application. We have special > requirement, when java app goes down we need response with 204 error code > instead 500 or 502 and this works like in charm

Re: Custom error page on SSL negotiation failure

2014-03-31 Thread Kiril Kalchev
Hi, Thank you very much for the fast response. It turns out that I have somehow missed the response. Variable ssl_protocol is what I need. Regards, Kiril On Mar 17, 2014, at 5:32 PM, Lukas Tribus wrote: > Embedded Variables smime.p7s Description: S/MIME cryptographic signature _

RE: Custom error page on SSL negotiation failure

2014-03-17 Thread Lukas Tribus
Hi, > I am trying to stop my customers that are trying to connect from an > insecure web browser (my goal is to use only TLS1.2). I have read > the documentation and I am able to set correct ssl ciphers and > protocols on the server side, but I am interested in serving custom > page when they are

Re: custom handler module - dynamic response with unknown content length

2014-03-01 Thread Yasser Zamani
On Sat 01 Mar 2014 06:27:38 PM IRST, Yasser Zamani wrote: The transcoding process already is doing by an external process, ffmpeg, into an incomplete file. I just need to read from first of this incomplete file one by one chunks and send them to client until seeing a real EOF. I have followin

Re: custom handler module - dynamic response with unknown content length

2014-03-01 Thread Yasser Zamani
On Sat 01 Mar 2014 03:01:42 PM IRST, Maxim Dounin wrote: Hello! The ngx_http_output_filter() function can be called more than once, but usually it doesn't make sense - instead, one should install r->write_event_handler and do subsequent calls once it's possible to write additional data to sock

Re: custom handler module - dynamic response with unknown content length

2014-03-01 Thread Maxim Dounin
Hello! On Sat, Mar 01, 2014 at 12:48:11PM +0330, Yasser Zamani wrote: > Thanks for your response > > On Sat 01 Mar 2014 03:41:24 AM IRST, Maxim Dounin wrote: > >Hello! > > > >You've tried to send the same chain with the same buffer multiple > >times. After a buffer is sent for the first tim

Re: custom handler module - dynamic response with unknown content length

2014-03-01 Thread Yasser Zamani
Thanks for your response On Sat 01 Mar 2014 03:41:24 AM IRST, Maxim Dounin wrote: Hello! You've tried to send the same chain with the same buffer multiple times. After a buffer is sent for the first time, its pointers are adjusted to indicate it was sent - b->pos moved to b->last, and buff

Re: custom handler module - dynamic response with unknown content length

2014-02-28 Thread Maxim Dounin
Hello! On Fri, Feb 28, 2014 at 10:44:38PM +0330, Yasser Zamani wrote: > Hi there, > > I learned some about how to write a handler module from [1] and [2]. > [1] http://blog.zhuzhaoyuan.com/2009/08/creating-a-hello-world-nginx-module/ > [2] http://www.evanmiller.org/nginx-modules-guide.html#compi

Re: Custom forced 503 page does not work

2013-07-31 Thread Maxim Dounin
Hello! On Wed, Jul 31, 2013 at 02:51:43AM -0400, skchopperguy wrote: > Hi, > > Nginx reads from top to bottom, just like you. In your example, you are > returning 503 (an action) before instructing to use your custom error page. > Just need to put your instructions first, then your actions...li

Re: Custom forced 503 page does not work

2013-07-30 Thread skchopperguy
Hi, Nginx reads from top to bottom, just like you. In your example, you are returning 503 (an action) before instructing to use your custom error page. Just need to put your instructions first, then your actions...like so: error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/sh

Re: Custom 401 page not displaying or not prompting for credentials

2013-07-14 Thread Michael
Added auth_basic off; as so: location = /401.html { auth_basic off; root G:/Files; } returns error 403 and 'access forbidden by rule' error. So then I added allow all; like this: location = /401.html { allow all; auth_ba

Re: Custom 401 page not displaying or not prompting for credentials

2013-07-14 Thread Maxim Dounin
Hello! On Sat, Jul 13, 2013 at 02:40:14PM +0100, Michael wrote: > Hello, I was trying to set a custom error 401 page on my Nginx server > version 1.5.1 using the following methods: > > error_page 401 /401.html > By itself it still displays the default site > > error_page 401 http://example.com/