Unable to rewrite a webpage in nginx

Avatar
  • updated
  • Answered

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;

server_name 192.168.17.53; #My Nginx Server

rewrite ^/(.*)$ http://mailsvr.parco.net.pk/mail/ permanent;

client_max_body_size 100m;

location /{

 proxy_pass http://mailsvr.parco.net.pk/;# mailserver internal name

proxy_redirect http://mailsvr.parco.net.pk/mailsvr/mail/ http://mailsvr.parco.net.pk/mail/; # redirecting mailserver webpage

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $remote_addr;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_read_timeout 240;

proxy_buffering off;

}#end location

}#end server

}#end http

Avatar
IMH Support Agent 2
  • Answered

Hello Zeeshan,

Sorry for the issues with the page rewrite using NGINX. Unfortunately, we only provide limited support in regards to NGINX.  We use it with our WordPress Hosting for caching.  If this is a server issue, then I would recommend that you contact our live technical support team via phone/chat/email.  If it's not a server issue and more of a coding one, then we recommend that you speak with an experienced NGINX administrator, or web developer who is familiar with using NGINX.  Apologies that we can not help you directly with this issue.

If you have any further questions or comments, please let us know.

Kindest regards,

Arnel C.