Need to remove folder name from URL

strtwtsn nginx-forum at nginx.us
Wed Feb 11 16:35:03 UTC 2015


Will do...in case this helps...here's my config

server {
listen 80;
client_max_body_size 4G;
server_name example1.com;
passenger_enabled on;
root /home/<user>/current/public;
rails_env production;
keepalive_timeout 5;


location = / {
proxy_pass http://example1.com/<folder>;   // This is to silently redirect
the root of http://example1.com to http://example1.com/<folder>
}

location ~ ^/assets/ {
root /home/<user>/current/public;
    expires max;
    add_header Cache-Control public;
    add_header ETag "";
    break;
  }


location /system {
proxy_pass http://www.example.com;  // This is to silently redirect
http://example1.com/system to example.com/system, but to still show
example1.com/system in the address bar
}



location ^~/wcmc {
proxy_pass http://example.com/<folder>;  // This silently redirects
example1.com/ to example.com/<folder> 
}
}


This all works in that

going to example1.com gives me the page at example.com/<folder>

Clicking the links on the page take me to the correct page on example.com,
but show example1.com in the addressbar.

eg

example1.com/<folder>/history  


I need to hide the <folder> part of it.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,256577,256584#msg-256584



More information about the nginx mailing list