Using the mirror module
Kenny Meyer
knny.myer at gmail.com
Tue Mar 13 21:58:25 UTC 2018
Hi Roman,
> Are there any errors in error.log?
No errors…
> And what happens if you switch www.example.com and staging.example.com?
Then I get redirected to staging.example.com and I don’t see any requests being logged on example.com
> On 13 Mar, 2018, at 18:34, Roman Arutyunyan <arut at nginx.com> wrote:
>
> Hi Kenny,
>
> On Tue, Mar 13, 2018 at 05:37:52PM -0300, Kenny Meyer wrote:
>> Hi,
>>
>> I’m having trouble using the new mirror module. I want to mirror incoming requests from Nginx to other upstream servers. 1) a production server 2) a staging server
>>
>> This is my config:
>>
>> server {
>> listen 80 default_server;
>> listen [::]:80 default_server;
>>
>> location / {
>> mirror /mirror;
>> proxy_pass http://www.example.com;
>> }
>>
>> location /mirror {
>> internal;
>> proxy_pass http://staging.example.com$request_uri;
>> }
>> }
>>
>> So, I request http://myserver.com (where Nginx is hosted) and it successfully redirects me to www.example.com, however I don’t see any requests hitting staging.example.com.
>>
>> What could be the error?
>
> The configuration looks fine.
> Are there any errors in error.log?
> And what happens if you switch www.example.com and staging.example.com?
>
> --
> Roman Arutyunyan
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
Kenny Meyer
www.kennymeyer.net
More information about the nginx
mailing list