RunCloud
Staging Environment
- Create a new web application on the 3flow Staging Server (IP: 167.99.198.190)
- Assign new system user
- Create database and assign to staging system user
- Create deployment key for new system user
- Link web application to Git and add webhook to GitHub repo
- Continue normal WordPress setup
- In web application settings, assign Web Application Type to WordPress
- Enable RunCloud Hub
- Add http authentication
nginx Config for WebP images
# Type: location.main-before
location ~* ^(/wp-content/.+)\.(png|jpe?g)$ {
set $base $1;
set $webp_uri $base$webp_suffix;
set $webp_old_uri $base.$2$webp_suffix;
set $root "{FULL_PATH TO WEBAPP eg. /home/precious/webapps/Precious}";
root $root;
add_header Vary Accept;
if ( !-f $root$webp_uri ) {
add_header X_WebP_SP_Miss $root$webp_uri;
}
try_files $webp_uri $webp_old_uri $uri =404;
}
# Type: location.http
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
nginx Image Caching
# Type: location.main-before
location ~* \.(ico|css|gif|jpe?g|png|gz|zip|flv|rar|wmv|avi|css|js|swf|png|htc|mpeg|mpg|txt|otf|ttf|eot|woff|woff2|svg)$ {
expires 1M;
add_header Cache-Control "public";
}