This post explain, how to configure Nginx web server for Static Website. At the current time, Jekyll,Octopress, pelican are very popular static site generator. Generally for static website we use html files.
Note: This post share the Nginx Configuration file settings for static website.
We worked on couple of website which were generated with Jekyll,Octopress and pelican.In this post we are sharing the Nginx configuration file for static website.
We have added some feature in this Nginx configuration file which will help your Nginx site to load quickly. These features are given below –
1. Enable compression
2. Enable Leverage Browsing
We believe you have already install Nginx on your system (Install Nginx on CentOS 7)
Given below is the Nginx Configuration file settings –
Replace example.com with your domain name.
After saving the file.Run the command
nginx -t , to check if any error in configuration file
Restart the Nginx Service.
On CentOS 7 / RHEL 7
systemctl restart nginx
On CentOS 5,6 / RHEL 5,6
service nginx restart
On Debian / Ubuntu
sudo service nginx restart OR sudo /etc/init.d/nginx restart