Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-21440

[GSS](7.4.z) UNDERTOW-1864 - EAP returns 403 even after adding the welcome file to unmanaged exploded deploy

XMLWordPrintable

    • False
    • False
    • +
    • Undefined
    • Workaround Exists
    • Hide

      There are some workarounds.
      A. Redeploy the webapp.
      B. Add welcome file path to the request via filter as follows.
      Then localhost:8080/hello/ will be able to access the welcome file without redeploy.

                  <server name="default-server">
                      ...
                      <host name="default-host" alias="localhost">
                          ...
                          <filter-ref name="index-rewrite-filter"/>
                      </host> 
                  </server>
                  ...
                  <filters>
                      <expression-filter name="index-rewrite-filter" expression="regex(pattern='/(.*?)/', full-match=true) -> rewrite('/$${1}/index.html')"/>
                  </filters>
      

      If modify the regex as regex(pattern='/(.*?)/$', then that can be accessed by requests other than context root.

                      <expression-filter name="index-rewrite-filter" expression="regex(pattern='/(.*?)/$', full-match=true) -> rewrite('/$${1}/index.html')"/>
      

      Like as following urls.

      localhost:8080/hello/
      localhost:8080/hello/test1/ 
      localhost:8080/hello/test1/test2/
      
      Show
      There are some workarounds. A. Redeploy the webapp. B. Add welcome file path to the request via filter as follows. Then localhost:8080/hello/ will be able to access the welcome file without redeploy. <server name= " default -server" > ... <host name= " default -host" alias= "localhost" > ... <filter-ref name= "index-rewrite-filter" /> </host> </server> ... <filters> <expression-filter name= "index-rewrite-filter" expression= "regex(pattern= '/(.*?)/' , full-match= true ) -> rewrite( '/$${1}/index.html' )" /> </filters> If modify the regex as regex(pattern='/(.*?)/$', then that can be accessed by requests other than context root. <expression-filter name= "index-rewrite-filter" expression= "regex(pattern= '/(.*?)/$' , full-match= true ) -> rewrite( '/$${1}/index.html' )" /> Like as following urls. localhost:8080/hello/ localhost:8080/hello/test1/ localhost:8080/hello/test1/test2/
    • Hide

      1. create exploded web app.

      $ unzip hello.war.zip

      2. deploy exploded web app.

      /deployment=hello:add(runtime-name="hello.war", enabled=true, content=[{"path"=>"/PATH_TO/hello.war", "archive"=>false}])

      3. The application doesn't have welcome file, so the eap returns 403 for the following request.

      $ curl -v http://localhost:8080/hello/

      -> 403.
      4. add index.html manually.

      $ touch /PATH_TO/hello/index.html

      5. EAP still respond 403 even though the index.html was added.

      $ curl -v http://localhost:8080/hello/

      -> 403.

      Then the index.html could be accessed.

      $ curl -v http://localhost:8080/hello/index.html

      -> 200.
      6.redeploy / reboot eap

      /deployment=hello:redeploy

      or shutdown/start
      7. The static file can be accessed as 200.

      $ curl -v http://localhost:8080/hello/

      -> 200.

      Show
      1. create exploded web app. $ unzip hello.war.zip 2. deploy exploded web app. /deployment=hello:add(runtime-name= "hello.war" , enabled= true , content=[{ "path" => "/PATH_TO/hello.war" , "archive" => false }]) 3. The application doesn't have welcome file, so the eap returns 403 for the following request. $ curl -v http: //localhost:8080/hello/ -> 403. 4. add index.html manually. $ touch /PATH_TO/hello/index.html 5. EAP still respond 403 even though the index.html was added. $ curl -v http: //localhost:8080/hello/ -> 403. Then the index.html could be accessed. $ curl -v http: //localhost:8080/hello/index.html -> 200. 6.redeploy / reboot eap /deployment=hello:redeploy or shutdown/start 7. The static file can be accessed as 200. $ curl -v http: //localhost:8080/hello/ -> 200.

      This issue is for exploded web app.
      If sending a request to context-root or other directory even once before adding a welcome file, EAP returns 403 even after adding the content.

      http://localhost:8080/hello/ -> 403
      

      But the following request can return the content without redeploy.

      http://localhost:8080/hello/index.html -> 200
      

              rhn-support-rmartinc Ricardo Martin Camarero
              spyrkob Bartosz Spyrko-Smietanko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: