Using the mirror module

jlangr nginx-forum at
Thu Aug 9 23:04:50 UTC 2018

Hi Francis--

We got this working to wrap up the day. My ignorance of nginx meant that I
was interpreting the example literally--I viewed the "/mirror" as the name
for the internal route, but that actually becomes part of the URL the mirror
location proxy forwards to.

http {
    server {
        listen 3333;
        server_name localhost;

        location / {
            mirror /;
            resolver;   # I shouldn't need this, will test tomorrow

        location = / {
            set $upstream_endpoint;
            proxy_pass $upstream_endpoint$request_uri;

That works like a champ. Initially I was trying to use localhost as the
proxy_pass destination, and had turned on port forwarding at my router, but
for whatever reason that was having troubles.

Many thanks in any case!


Posted at Nginx Forum:,279036,280832#msg-280832

More information about the nginx mailing list