I have two pages:
- PageA.html
- PageB.html
PageA contains a link to PageB, specified this way:
add(new BookmarkablePageLink<Void>("link", PageB.class, parameters));
This works perfectly fine as long as PageB is just a regular http page. The link url on PageA is displayed as "http://www.example.com/PageB".
The problem occurs when I change PageB to require https, like so:
@RequireHttps
public class PageB extends WebPage {
...
}
Now, suddenly the link url on PageA uses the local ip instead of the domain name, this way "https://127.0.0.1/PageB". This means that the visitors on my site cannot access PageB since the url is incorrect.
How come it uses the local ip in the url when PageB uses "@RequireHttps"? I would like the url to use the domain name as before, and only change protocol from http to https.
I am running my webapp in Tomcat 7 under Nginx.