Zeeshan Opel
September 12, 2019 02:12AM
I am trying to rewrite a url in nginx.

When i am accessing mail.parco.net.pk in browser, it opens below link:

But in actual it should open http://mailsvr.parco.net.pk/mail/mailbox.nsf

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 http://mailsvr.parco.net.pk$request_uri;
#rewrite ^/mailsvr/(.*) /$1 break;
#rewrite ^/http://mailsvr.parco.net.pk(.*)$
http://mailsvr.parco.net.pk/mail=$1 permanent;
#return 301 http://$host$request_uri;
client_max_body_size 100m;

location /{

#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
nginx mailing list
Subject Author Posted

Rewriting url in nginx

Zeeshan Opel September 12, 2019 02:12AM

Re: Rewriting url in nginx

Zeeshan Opel September 12, 2019 06:54AM

Re: Rewriting url in nginx

Aleksandar Lazic September 12, 2019 08:52AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 63
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready