function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Žiga MakucŽiga Makuc 

Portal login site + reverse proxy

I'm using nginx as reverse proxy to access public site. The problem is when I try to login in that portal login site, that "portal" automatically redirects to https://mydomain.cs14.force.com/... I want it to stay on /, not mydomain.cs14.force.com/. Is this possible and how?
 
Sumitkumar_ShingaviSumitkumar_Shingavi
There is a parameter called "startURL" in URL you can pass to decide Landing page. You can also set it from SiteController/SiteLoginController class.

PS: if this answers your question then hit Like and mark it as solution!
Žiga MakucŽiga Makuc
I have already set startURL, but this redirects to Absolute path, not Relative. So in my case, doesn't do what I want. It doesn't redirect to /startURL but to https://mydomain.cs14.force.com/startURL.
Sumitkumar_ShingaviSumitkumar_Shingavi
Can you write sample of what you need and what you see now? I will definately try to help you getting that url as expected.
Žiga MakucŽiga Makuc
I have nginx reverse proxy, which requires from you a certificate. If you pass the correct certificate it makes a reverse proxy to "https://something.cs14.force.com/". So what I see is "https://mycustomdomain.com" and no reference to salesforce whatsoever. Even if I go through different sites..for example "https://something.cs14.force.com/anotherSite", I still see "https://mycustomdomain.com/anotherSite", which works fine.

But, when I try to login to custom portal using
public Pagereference login(){
Pagereference pr = Site.login(user,pass,'/home');
pr.setRedirect(true); // or not, doesn't work either way
return pr;
}
It redirects me to "https://something.cs14.force.com/home" and not "/home". So insted of what I should see "https://mycustomdomain.com/home" it redirects me to "https://something.cs14.force.com/home" - which is not allowed, because only "Reverse proxy" server has access to that site.

Is that clearer now?
 
Sumitkumar_ShingaviSumitkumar_Shingavi
Yes, very clear now! I am not sure on whatever you trying is at all possible. You might try replacing '/home' by 'https://mycustomdomain.com/home'. You also might need to look at writing URL over-riding controller. I have my own site www.cloudzeal.com running on Force.com and I have used domain forwarding facility from Bigrocks.

PS: if this answers your question then hit Like and mark it as solution!
 
Žiga MakucŽiga Makuc
We have solved this by "Substitute" and and "Proxy remapping" using Apache instead of Nginx. Should anyone have the same problem, do not hesitate to contact me.