P
P
pikafas12020-06-16 14:57:20
Nginx
pikafas1, 2020-06-16 14:57:20

Mirroring an nginx page?

Hello, I came across such a module ngx_http_mirror_module,
as I understand it, it can mirror the page, but for some reason I didn’t try to set it up, it doesn’t work at all, could someone please show how the code should look right so that when you go to site1.com, site2 opens .com

location / {
    mirror /mirror;
    mirror_request_body off;
    proxy_pass http://backend;
}

location = /mirror {
    internal;
    proxy_pass http://log_backend;
    proxy_pass_request_body off;
    proxy_set_header Content-Length "";
    proxy_set_header X-Original-URI $request_uri;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question