0

I'm configuring a cloud server which use NGINX as reverse proxy to serve different applications on different URI (all the applications are on the same wildfly standalone instance). To be more specific i've a JSF application with a contextroot, let's say, /jsfcontext and i've set up a NGINX location like /mypublicuri. What happens is that when I navigate to https://myserver.com/mypublicuri/index.xhtml i receive the following error: /mypublicuri/index.xhtml Not Found in ExternalContext as a Resource. I'm pretty sure it's related to a missing internal redirect route or some kind of "hack" that i need to specify in order to make everything work but i'm a newbie in NGINX and I don't know how to properly set everything up. Thanks for the help Cheers

Read NGINX documentation but my lack of english knowledge makes difficoult to understand what should I have to do

My actual NGINX config

server {
    server_name myserver.com www.myserver.com;
    access_log /usr/share/logs/access.log;
    error_log /usr/share/logs/error.log;
    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_intercept_errors on;
        location /anotherworkingapp {
            add_header Allow "GET, POST, HEAD, PUT, DELETE" always;
            proxy_pass http://127.0.0.1:8080$request_uri;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
        }
        location /mypublicuri {
            proxy_pass http://127.0.0.1:8080/jsfcontext$request_uri;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
        }
    }
}
Luchetti
  • 41
  • 7
  • But if you access `http://localhost:8080/jsfcontext/index.xhtml` you get the desired result? – Selaron Nov 08 '19 at 11:23
  • From using apache like this, I know I also have to configure a 'reverse' https://stackoverflow.com/questions/15203177/apache-in-front-of-jsf – Kukeltje Nov 08 '19 at 11:31
  • @Selaron Thanks for your reply, nope I get a 404 by NGINX because no location was defined with /jsfcontext path – Luchetti Nov 08 '19 at 14:54
  • @Kukeltje thanks for your reply, i read the whole link you provided... I think there should be a different way than use a rewrite filter. If I had to do so then i prefer use JAX-RS with JSF instead – Luchetti Nov 08 '19 at 14:56
  • I was not refering to the rewrite filter, just the additional reverse config. For me that was sufficient – Kukeltje Nov 08 '19 at 18:37

0 Answers0