Juan Hernandez has uploaded a new change for review. Change subject: userportal: Serve static content with web server ......................................................................
userportal: Serve static content with web server Currently all the content of the user portal is served by the application server. This usually requires two network hops (one from client to web server and an additional one from web server to application server) and wastes expensive resources inside the application server. This patch configures the web server so that it will serve the static content of the user portal directly. Change-Id: I725ef50beb223b5bb38d48ea93dc1ea8b406b12e Signed-off-by: Juan Hernandez <[email protected]> --- M packaging/fedora/setup/ovirt-engine-proxy.conf.in 1 file changed, 71 insertions(+), 23 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/11762/1 diff --git a/packaging/fedora/setup/ovirt-engine-proxy.conf.in b/packaging/fedora/setup/ovirt-engine-proxy.conf.in index e51e934..a1edfa6 100644 --- a/packaging/fedora/setup/ovirt-engine-proxy.conf.in +++ b/packaging/fedora/setup/ovirt-engine-proxy.conf.in @@ -2,33 +2,81 @@ #raw # -# Redirect all requests to the application server using the AJP -# protocol. -# -# The following parameters are recommended: -# -# retry=5 -# -# This is needed to make sure that connections to the application server -# are recovered in a short time interval (5 seconds at the moment) -# otherwise when the application server is restarted the web server will -# refuse to connect during 60 seconds. -# -# timeout=600 -# -# This is needed to make sure that long RESTAPI requests have time to -# finish before the web server aborts the request as the default timeout -# (controlled by the Timeout directive in httpd.conf) is 60 seconds. +# Parameters shared by any connection to the application server (note that if +# you change the address or port here you will also need to change it wherever +# that proxy is used, as the complete URL is used as the identifier of the +# proxy): # #end raw -ProxyPass / ajp://localhost:${basedefs.JBOSS_AJP_PORT}/ retry=5 timeout=3600 + +<Proxy ajp://localhost:${basedefs.JBOSS_AJP_PORT}> + #raw + # + # This is needed to make sure that connections to the application server + # are recovered in a short time interval (5 seconds at the moment) + # otherwise when the application server is restarted the web server will + # refuse to connect during 60 seconds. + # + #end raw + ProxySet retry=5 + + #raw + # + # This is needed to make sure that long RESTAPI requests have time to + # finish before the web server aborts the request as the default timeout + # (controlled by the Timeout directive in httpd.conf) is 60 seconds. + # + #end raw + ProxySet timeout=3600 +</Proxy> #raw # -# Remove the Expect headers from API requests (this is needed to fix a -# problem with some API clients): +# Configuration specific to requests for the REST API: # #end raw -<IfModule mod_headers.c> - RequestHeader unset Expect early -</IfModule> +<LocationMatch ^/(api(/.*)?$)> + ProxyPassMatch ajp://localhost:${basedefs.JBOSS_AJP_PORT}/$1 + + #raw + # + # Remove the Expect headers from API requests (this is needed to fix a + # problem with some API clients): + # + #end raw + <IfModule mod_headers.c> + RequestHeader unset Expect early + </IfModule> +</LocationMatch> + +#raw +# +# Configuration to serve all the user portal static content directly from the +# web server, dynamic content still needs to go to the application server: +# +#end raw +Alias /UserPortal /usr/share/ovirt-engine-userportal + +<Directory /usr/share/ovirt-engine-userportal> + #raw + # + # Use this for Apache 2.2 or older: + # + # Order Deny,Allow + # Allow from all + # + # And this for Apache 2.4 or newer: + # + #end raw + Require all granted +</Directory> + +<LocationMatch "^/(UserPortal/org\.ovirt\.engine\.ui\.userportal\.UserPortal/(UserPortal\\.html|GenericApiGWTService))$"> + ProxyPassMatch ajp://localhost:${basedefs.JBOSS_AJP_PORT}/$1 +</LocationMatch> + +# +# Everything not explictly covered above will be sent directly to the +# application server: +# +ProxyPass / ajp://localhost:${basedefs.JBOSS_AJP_PORT}/ -- To view, visit http://gerrit.ovirt.org/11762 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725ef50beb223b5bb38d48ea93dc1ea8b406b12e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
