Deploying to Microsoft Internet Information Server (IIS)
Internet Information Services (IIS) for Windows® Server is a flexible, secure and manageable Web server for hosting anything on the Web. From media streaming to web applications, IIS’s scalable and open architecture is ready to handle the most demanding tasks.
- A Gatsby project set up. (Need help creating one? Follow the Quick Start)
Deploying to IIS is a matter of running
gatsby build and copying the contents of your local
public folder to the
wwwroot folder of your IIS web server.
One important and sometimes overlooked aspect is to configure caching correctly. The following configuration will give you a good starting point in line with Gatsby’s suggested approach to caching.
- Install the IIS URL Rewrite module if it’s not already there. It’s required to define the
- Add a
web.configfile to the
staticfolder of your Gatsby project. It will be copied unchanged to the
Please note that local settings you make for your web in IIS Manager change the
web.config file. You have to be careful to copy any changes to
web.config on your server back to the version in your Gatsby