Rewriting url in nginx

Zeeshan Opel zeeshanopel at
Thu Sep 12 06:08:15 UTC 2019

I am trying to rewrite a url in nginx.

When i am accessing in browser, it opens below link:
But in actual it should open

Below is my nginx conf file.

worker_processes  1;
worker_rlimit_nofile    30000;
events {
    worker_connections  1024;

http {
    include           mime.types;
    default_type       application/octet-stream;
    sendfile         on;
    keepalive_timeout   65;
    server {
        listen             80;
        return    301$request_uri;
        #rewrite ^/mailsvr/(.*) /$1 break;
        #rewrite ^/*)$$1 permanent;
        #return    301    http://$host$request_uri;
        client_max_body_size    100m;

        location /{
                #proxy_pass           ;

                #proxy_set_header     X-Real-IP        $remote_addr;
                #proxy_set_header     X-Forwarded-For        $remote_addr;
                #proxy_set_header    Host            $host;
                #proxy_set_header    X-Forwarded-Proto    $scheme;

                proxy_read_timeout                240;
                proxy_buffering                    off;
            }#end location
    }#end server

}#end http

Zeeshan Qaiser Opel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list