# How to use proxy\_set\_header set Cookie

**URL:** <https://www.ruby-forum.com/t/how-to-use-proxy-set-header-set-cookie/191305>\
**Category:** NGINX\
**Created:** [July 9, 2010, 12:37pm UTC](https://www.ruby-forum.com/t/how-to-use-proxy-set-header-set-cookie/191305 "2010-07-09T12:37:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaoxinming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e9bcb4/32.png) [@yaoxinming](https://www.ruby-forum.com/u/yaoxinming)\
**Post date:** [July 9, 2010, 12:37pm UTC](https://www.ruby-forum.com/t/how-to-use-proxy-set-header-set-cookie/191305/1 "2010-07-09T12:37:47Z")

</div>

I user a nginx to proxy a java web server,and want to add a cookie when  
proxy the url,my config :

location /el {  
proxy\_set\_header Cookie “mysession=$arg\_ccvalue”;  
proxy\_pass [http://172.16.1.30:8080/trance](http://172.16.1.30:8080/trance);

```
    }

```

but i can get the cookie in my java web application

if anyone can give some advice?

thanks

---

<div class="post-metadata">

**Author:** ![yaoxinming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e9bcb4/32.png) [@yaoxinming](https://www.ruby-forum.com/u/yaoxinming)\
**Post date:** [July 10, 2010, 2:47pm UTC](https://www.ruby-forum.com/t/how-to-use-proxy-set-header-set-cookie/191305/2 "2010-07-10T14:47:58Z")

</div>

try this, but i’m not sure.

location /el {  
proxy\_set\_header “Cookie: mysession=$arg\_ccvalue”;  
proxy\_pass [http://172.16.1.30:8080/trance](http://172.16.1.30:8080/trance);

```
    }

```
