StoreFront display server name

Configure StoreFront 3 and IIS to display the current server name on the pages.

Following a question from Tony in the comments of this article: StoreFront 3 optimizations.

When load balancing Citrix StoreFront, it is important to always know which current StoreFront server we are connect to.

Unfortunately there is no built-in feature in Citrix StoreFront to do that, so we have to play with Microsoft IIS and the StoreFront configuration.

Follow the procedure below to display the server name on your Citrix StoreFront web pages.

IIS Configuration

Connect to your StoreFront server and open IIS console (inetmgr.exe). Select your StoreFront website (Default Web Site by default).

Select the StoreFront website in IIS
Select the StoreFront website in IIS

In the Features view, select HTTP response headers.

Select HTTP response headers
Select HTTP response headers

Select Add, and then type :

  • Name: SF-ServerName
  • Value: SF02
Add new HTTP response header
Add new HTTP response header

Select OK.

New HTTP response header created
New HTTP response header created

IIS is now configured.

Note: Make sure to repeat the operation on all your servers.

StoreFront configuration

Go to C:\inetpub\wwwroot\Citrix\<StoreName>Web\Custom and open style.css.

Add the following code:

Go to C:\inetpub\wwwroot\Citrix\<StoreName>Web\Custom and open script.js.

Add the following code:

 

If needed, restart IIS with the following command:

Testing

Connect to your StoreFront website, you should see the server name at the bottom of the page.

Connect to your StoreFront website
Connect to your StoreFront website

Logon to the webpage, you should also see the server name at the bottom of the applications page.

Server name is displayed
Server name is displayed

You can play with the CSS to display the server name wherever you want.

Note: Make sure to propagate the changes in the StoreFront configuration on all servers.



42 COMMENTS

  1. Hi Nicolas. Thanks for this. I believe script.css should be script.js. Also, the changes to the custom files can be pushed to the other servers by doing Propagate Changes, but the Response Header needs to be configured separately on each server.

  2. Hi Nicolas.
    Great article.
    This works fine for me, it’s THE much appropriate change than any other solutions found at all.
    Keep going 🙂

    • I too would like to know how to prevent the script running on the Receiver client. Especially 4.4, you will get a javascript error pop-up.

  3. This doesn’t work for Receiver client for Windows. How to display StoreFront server name on Receiver client ?

  4. On the Receiver 14.4.0.8014 client I’m seeing a script error. How do you prevent it from running on the receiver client? Or better yet how do you get it to run and display the footer correctly in the receiver 14.4.0.8014 client.

      • +1 On Web its totally fine but i too receiving Script error for Receiver. please let me know the configuration for Receiver ?

        • Receiver for Windows (also the Receivers for Mac and Linux) is slightly more complicated because the Web UI is actually running off a cache on the local disk, rather than running straight off the web server. Here’s an updated code sample which should work for both the web page and the Receiver clients. It uses a Citrix API (CTXS.ExtensionAPI.proxyRequest()) to make the AJAX call to the server. I’m making the request to an arbitrary file on the server (custom/style.css) – you could easily create an empty file somewhere on the server to reduce the data being downloaded, if you wanted.

          CTXS.Extensions.afterDisplayHomeScreen = function () {
          CTXS.ExtensionAPI.proxyRequest({
          url: ‘custom/style.css’,
          success: function (data, textStatus, xmlHttpRequest) {
          // Extract HTTP header values from the response
          var servername = xmlHttpRequest.getResponseHeader(‘SF-ServerName’);
          $(‘.customAuthFooter’).html(servername);
          $(‘#customBottom’).html(servername);
          }
          });
          };

  5. You have a great idea using HTTP headers. It appears this does not work on the Citrix Receiver 14.4.0.8014 client as it produces script errors. How can you get it to not run on the Citrix 14.4.0.8014 client or better yet run correctly?

  6. You have a great idea using HTTP headers. It appears this does not work on the Citrix Receiver 14.4.0.8014 client as it produces script errors. How can you get it to not run on the Citrix 14.4.0.8014 client or better yet run correctly?

  7. Hi,

    I have StoreFront 3.5 and tried to perform the customizations however the footer is not appearing.

    Hi Vinh can you share how you got yours working in the end?

    Thanks.

    • Harold,

      In my case, I have 2 StoreFront servers but the WEB.CONFIG on one of them did not get updated. Make sure they are both the same if you have 2 or more servers.

      Vinh,

      • Hi Vinh,

        Thanks for getting back to me. I also have 2 SF servers. WEB.CONFIG … did I miss something from the steps above?

        Harold

        • Harold,

          Not sure if that would make any different though, but I actually added/modified the “HTTP Response Headers” from my Receiver Web instead of the one from “Default Web Site”. Because if you look at the screen shot it said “Local” in columm “Entry Type”. Also run IISReset or reboot may help too.

          Vinh,

        • Harold,

          Sad to say but I just made that change in Default Web Site and it did not make any different.

          Vinh,

        • Harold,

          I just check both of my “Style.css” & ” Script.js” and realize something different from what posted here.

          for my script.js I added these listed below.

          /* BEGINNING – Display Server Name */

          var req = new XMLHttpRequest();
          req.open(‘GET’, document.location, false);
          req.send(null);

          var servername = req.getResponseHeader(‘SF-ServerName’);

          $(‘.customAuthFooter’).html(servername);

          /* END – Display Server Name */

          and for my style.css

          /* BEGINNING – Display Server Name */

          .customAuthFooter
          {
          font-size:12px;
          color:Black;
          bottom:10px;
          text-align: center;
          }

          /* END – Display Server Name */

          Let me know if that help,

          Vinh,

          • Hi Vinh,

            Thanks for getting back to me. Unfortunately the value is still not showing in the footer. Will try to dig more into it later. Not a show stopper now and thanks for your tips.

            Harold

  8. I modified script.js a little so it is not executing and not showing ServerName on Receiver Client (which is not critical in my case as I need it to be displayed in StoreFront)

    if (CTXS.Device.isNativeClient()) {
    // Do not show SF-ServerName
    } else {
    var req = new XMLHttpRequest();
    req.open(‘GET’, document.location, false);
    req.send(null);

    var servername = req.getResponseHeader(‘SF-ServerName’);

    $(‘.customAuthFooter’).html(servername);
    $(‘#customBottom’).html(servername);
    }

    Did a quick test and works fine for me

  9. Hello,

    I am using StoreFront 3.8 on Server 2016 and I am unable to get this to work. I have tried everything I know of in my limited knowledge and can’t seem to figure out why. Is there something I might be missing?

      • I appreciate you trying. I still cannot get it to work. I wonder if one of my other customizations may be inhibiting this functionality.

        Thanks

  10. This method is a good alternative but it requires manual IIS settings on each SF servers and if you are building the SF server again then these have to be documented or remember to be set.
    we have a different method that will Dynamically query the servername and print it in the footer once a user logs in. it doesnt work on the receiver client due to Java calls and html codes.

  11. Hi Guys, I am using SF 2.6.0
    If someone can provide me steps (Step by step) to have the Storefront servername displayed at the bottom of Citrix receiver.

  12. @Serg – adding that if else statement did the trick for me and getting rid of that jscript error with the native receiver client on SF 3.11

  13. Thanks for the great article Nicolas.I tried on SF 3.12 and it works instantly on firefox but not in I.E !!! any pointers?

Comments are closed.