Redirect Address/Path with Nginx
Here is the nginx config file which redirects
http://mysite/escapeme/blah => http://mysite:3000/blah
user www-data;
worker_processes 3;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx_access.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
server {
listen *:80; ## listen for ipv4
access_log /var/log/nginx_access.log;
location /escapeme {
rewrite /escapeme(.*) $1 break;
proxy_pass http://127.0.0.1:3000;
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;
}
}
}
Nice one Kiran ! and that was quick !!