Nginx rewrite rule for Zimbra

Posted by Yusuf on Server Fault See other posts from Server Fault or by Yusuf
Published on 2012-11-13T19:25:05Z Indexed on 2012/11/14 17:05 UTC
Read the original article Hit count: 668

Filed under:
|
|

I'm trying to write a rewrite rule for Zimbra, which will allow me to use a hostname to access the Zimbra Desktop Web UI instead of the IP address and port.

The default Zimbra URLs are like this:

http://127.0.0.1:port/?at=long-encrypted-user-id
http://127.0.0.1:port/zimbra/?at=long-encrypted-user-id
http://127.0.0.1:port/desktop/login.jsp?at=long-encrypted-user-id

Here's what I have till now:

server {
    server_name hostname;
    location / {
            proxy_redirect                   off;
            proxy_set_header Host            $host;
            proxy_set_header X-Real-IP       $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass                       http://127.0.0.1:port/;
    }
}

This only replaces http://hostname by http://127.0.0.1:port in the background; Where I'm stuck is adding the ?at=long-encrypted-user-id to the URLs. Can somebody help?

© Server Fault or respective owner

Related posts about nginx

Related posts about rewrite