# Howto to modify headers returned by proxied server

**URL:** <https://www.ruby-forum.com/t/howto-to-modify-headers-returned-by-proxied-server/183262>\
**Category:** NGINX\
**Created:** [February 10, 2010, 11:11pm UTC](https://www.ruby-forum.com/t/howto-to-modify-headers-returned-by-proxied-server/183262 "2010-02-10T23:11:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [February 10, 2010, 11:11pm UTC](https://www.ruby-forum.com/t/howto-to-modify-headers-returned-by-proxied-server/183262/1 "2010-02-10T23:11:58Z")

</div>

Hi all,

I am trying to create a reverse proxy towards various web-enabled  
equipment.  
Things are starting to work.

I run into the following problem:  
Sometimes my some of web enabled equipment returns a request for basic  
authentication. The header has a format which causes problems. Example:

WWW-Authenticate: Digest realm="…", domain="/", etc

I think the domain="/" causes the problem: Each of my web-enabled  
equipment has its own location {} definition. I think the  
domain="/" should either not be there or list domain="/. Nginx  
forwards the header unchanged to the browser causing a basic  
authentication prompt. I guess after that the browser sends the uid/pw  
to nginx for url=/ (which does not lead back to the proper location  
 {} definition

How can I rewrite/modify this header?

kind regards  
Paul S.
