Setting Ispmanager, Nginx and Expires
Web Studio - site development of any direction. | web-ukraine.com
💼 Creation of modern websites of any complexity. | 👌 WEB-UKRAINE.COM

Setting Ispmanager, Nginx and Expires

5/56 ratings

Your server uses a popular set of software in the form of Control Panel ISPManager, Apache Web Server and nginx as the www-accelerator?
Please note that the nginx does not give headlines Expires.
If the PHP-generated documents is not always essential, it is desirable to give the static data with a similar title, allowing browsers visitors more actively use the cache.
There are two versions of how to extradite Expires header.

If you have a few sites in the text editor, open nginx.conf (in Linux-systems, it is usually located in /etc/nginx/, in FreeBSD – /usr/local/etc/nginx/), find the configuration unit server {} for your virtual host. In this configuration block has a section for handling static location Other office. It is in this section, add the line expires Xd, where X - the number of days of data validity. For example, expires 7d tells the browser that the images and CSS/JS files can be cached for a week.

Eventually you location the block will look like this:

The second way - to teach panel indicate the option expires statics on all virtual servers with nginx configuration file. To do this, create a file /usr/local/ispmgr/etc/server.templ with the following content:

Restarting the panel (killall ispmgr), create a new Website ISPManager through and check that the option expires correctly specified herein freshly created website in nginx.conf file.

You may also like

No Comment

You can post first response comment.

Leave a Reply

Виберіть спосіб спілкування
Звязатися з нами!
Ми готові до діалогу.