<div dir="ltr">Please help</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 12, 2019 at 11:08 AM Zeeshan Opel <<a href="mailto:zeeshanopel@gmail.com">zeeshanopel@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I am trying to rewrite a url in nginx. </div><div><br></div><div>When i am accessing <a href="http://mail.parco.net.pk" target="_blank">mail.parco.net.pk</a> in browser, it opens below link:</div><div><br></div><div><a href="http://mailsvr.parco.net.pk/mailsvr/mail/mailbox.nsf" target="_blank">http://mailsvr.parco.net.pk/mailsvr/mail/mailbox.nsf</a></div><div>But in actual it should open 

<a href="http://mailsvr.parco.net.pk/mail/mailbox.nsf" target="_blank">http://mailsvr.parco.net.pk/mail/mailbox.nsf</a>

</div><div><br></div><div>Below is my nginx conf file.</div><div><br></div>worker_processes  1;<br>worker_rlimit_nofile    30000;<br>events {<br>    worker_connections  1024;<br>}<br><br><br>http {<br>    include                         mime.types;<br>    default_type                      application/octet-stream;<br>    sendfile                   on;<br>    keepalive_timeout           65;    <br>    server {       <br>        listen              80;<br>        return    301     <a href="http://mailsvr.parco.net.pk" target="_blank">http://mailsvr.parco.net.pk</a>$request_uri;<br>        #rewrite ^/mailsvr/(.*) /$1 break;<br>        #rewrite ^/<a href="http://mailsvr.parco.net.pk" target="_blank">http://mailsvr.parco.net.pk</a>(.*)$ <a href="http://mailsvr.parco.net.pk/mail=$1" target="_blank">http://mailsvr.parco.net.pk/mail=$1</a> permanent;<br>        #return    301    http://$host$request_uri;        <br>        #server_name        192.168.17.53;<br>        client_max_body_size    100m;<br><br>        location /{        <br>                #proxy_pass                     <a href="http://172.17.5.157/" target="_blank">http://172.17.5.157/</a>;        <br>                #proxy_set_header     X-Real-IP        $remote_addr;<br>                #proxy_set_header     X-Forwarded-For        $remote_addr;<br>                #proxy_set_header    Host            $host;                <br>                #proxy_set_header    X-Forwarded-Proto    $scheme;            <br>                proxy_read_timeout                240;<br>                proxy_buffering                    off;<br>            }#end location<br>    }#end server<br>   <br>}#end http<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_6440711801137351355gmail_signature"><div>Zeeshan Qaiser Opel</div><div>+92-301-8446630</div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div>Zeeshan Qaiser Opel</div><div>+92-301-8446630</div></div>