Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#125 closed enhancement (fixed)

Allow add_header to affect 201 responses (and possibly any 2xx code).

Reported by: Nick Grimshaw Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version: 1.1.x
Keywords: Cc:
uname -a: Linux *** 2.6.35.13 #6 SMP Tue Sep 20 11:59:28 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx: nginx version: nginx/1.1.0
nginx: built by gcc 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
nginx: TLS SNI support enabled
nginx: configure arguments: --prefix=/usr --with-http_ssl_module --add-module=/usr/local/rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.7/ext/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --with-http_ssl_module --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_stub_status_module --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --sbin-path=/usr/sbin

Description

The documentation says:

add_header
Adds headers to the HTTP response when the response code is equal to 200, 204, 301, 302 or 304.

I'm trying to add Access-Control-Allow-Origin (and related) headers for cross-domain purposes, and I'm unable to use add_header to add it to 201 responses, which is making cross-domain resource-creation awkward.

I'd like it if add_header could be modified to support at least 201 responses, and preferably any success response (i.e. 2xx)

Change History (3)

comment:1 by Ruslan Ermilov, 12 years ago

In 4976/nginx:

(The changeset message doesn't reference this ticket)

comment:2 by Ruslan Ermilov, 12 years ago

Resolution: fixed
sensitive: 0
Status: newclosed

comment:3 by Maxim Dounin, 12 years ago

In 5052/nginx:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.