diff options
Diffstat (limited to 'meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf')
-rw-r--r-- | meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf index 89e575af5..7d65183ec 100644 --- a/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf +++ b/meta-openbmc-machines/meta-openpower/meta-ibm/recipes-httpd/nginx/files/nginx.conf @@ -65,12 +65,29 @@ http { ssl_prefer_server_ciphers on; location / { + # This location lets us serve the static pre-compressed webui + # content (rooted at /usr/share/www). Also if the URI points to + # something else (that is unmatched by other locations), we + # fallback to the rest server. This approach is based on the + # guide at https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content. + root /usr/share/www; + # For clients that support gzip encoding, serve them + # pre-compressed gzip content. For clients that don't, + # uncompress on the BMC. The module gunzip requires + # gzip_static to be set to 'always'; gzip_static is the + # module that serves compressed content for clients that + # support gzip. + gunzip on; + gzip_static always; + try_files $uri $uri/ @rest_server; + } + location @rest_server { # Use 127.0.0.1 instead of localhost since nginx will # first use ipv6 address of ::1 which the upstream server # is not listening on. This generates an error msg to # the journal. Nginx then uses the 127.0.0.1 and everything # works fine but want to avoid the error msg to the log. - proxy_pass http://127.0.0.1:8081/; + proxy_pass http://127.0.0.1:8081; # WebSocket support proxy_http_version 1.1; |