# Nginx proxy server

**URL:** <https://www.ruby-forum.com/t/nginx-proxy-server/242852>\
**Category:** NGINX\
**Created:** [August 3, 2015, 5:55am UTC](https://www.ruby-forum.com/t/nginx-proxy-server/242852 "2015-08-03T05:55:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 3, 2015, 5:55am UTC](https://www.ruby-forum.com/t/nginx-proxy-server/242852/1 "2015-08-03T05:55:22Z")

</div>

Hi everyone.  
I need to create a mirror site. And I use the server Nginx.  
I was able to configure the server. And everything works fine.  
But I have a problem when trying to login on my site. If a password is  
good  
I redirect to the original site ([www.example.com](http://www.example.com)). If the password is  
bad I  
stay on my website. And I do not know how to fix it.  
I need professional help.

I am using these configurations:  
location / {  
resolver 8.8.8.8 ;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Location $host;  
proxy\_pass [http://www.example.com](http://www.example.com);  
proxy\_redirect [example.com](http://example.com) [mirorr.com](http://mirorr.com);  
proxy\_cookie\_domain [example.com](http://example.com) [mirorr.com](http://mirorr.com);  
proxy\_cookie\_path / /mirorr/;  
proxy\_set\_header Accept-Encoding “”;  
proxy\_set\_header Referer [www.example.com](http://www.example.com);  
proxy\_set\_header Cookie $http\_cookie;  
}

I think that I return value Location “[www.example.com](http://www.example.com)” to “response  
header”.  
But how do I change it, I do not know. Or I’m wrong.

Posted at Nginx Forum:

> **[Nginx proxy server](https://forum.nginx.org/read.php?2,260716,260716#msg-260716)**
>
> Hi everyone. I need to create a mirror site. And I use the server Nginx. I was able to configure the server. And everything works fine. But I have a problem when trying to login on my site. If a password is good I redirect to the original site...

---

<div class="post-metadata">

**Author:** ![goga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f17d59/32.png) [@goga](https://www.ruby-forum.com/u/goga)\
**Post date:** [August 5, 2015, 12:38am UTC](https://www.ruby-forum.com/t/nginx-proxy-server/242852/2 "2015-08-05T00:38:13Z")

</div>

On Mon, Aug 3, 2015 at 12:54 AM, goga [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi everyone.  
> I need to create a mirror site. And I use the server Nginx.  
> I was able to configure the server. And everything works fine.  
> But I have a problem when trying to login on my site. If a password is good  
> I redirect to the original site ([www.example.com](http://www.example.com)). If the password is bad I  
> stay on my website. And I do not know how to fix it.  
> Isn’t this something you can/should handle in the language side? Btw,  
> which language are you using? PHP, Perl, Python, Ruby?

–  
Thiago F.

---

<div class="post-metadata">

**Author:** ![goga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f17d59/32.png) [@goga](https://www.ruby-forum.com/u/goga)\
**Post date:** [August 5, 2015, 4:19pm UTC](https://www.ruby-forum.com/t/nginx-proxy-server/242852/3 "2015-08-05T16:19:21Z")

</div>

## Thiago F. Wrote:

> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)  
> None. I only use the configuration file in  
> /etc/nginx/sites-avalible/\*.conf  
> Only settings virtualhosts.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,260716,260789#msg-260789](http://forum.nginx.org/read.php?2,260716,260789#msg-260789)
