I made “myproject.com” (for example) to be as “http://localhost:8080/MyProject/” using Nginx’s proxy_pass option. All works ok, but PrimeFaces stylesheets and scripts tries to go to “/MyProject/file”, what isn’t good because of proxing to nonexistent “http://localhost:8080/MyProject/MyProject/file”.
How can I made PF use ./file instead of /MyProject/file? Making Nginx’s location block or link to MyProject folder is bad variant.
I made myproject.com (for example) to be as http://localhost:8080/MyProject/ using Nginx’s proxy_pass option. All
Share
Even though I have the strong impression that this problem really needs to be solved in the Ngnix proxy side, I’ll explain how you could “workaround” it from the JSF side on.
JSF resources are represented by the
Resourceclass wherein thegetRequestPath()method is responsible for returning the resource URL. You could create a customResourceimplementation wherein thegetRequestPath()is implemented/overridden accordingly.Now, to override the default JSF
Resourceby this custom implementation, you need to create a customResourceHandlerimplementation wherein you return the customResourceimplementation instead in thecreateResource()method.Finally, to get it to run, register it as
<resource-handler>in thefaces-config.xml.