perf(): assets cache and php perf improvement
This commit is contained in:
@@ -56,6 +56,7 @@ http {
|
||||
root /rainloop;
|
||||
index index.php;
|
||||
charset utf-8;
|
||||
|
||||
client_max_body_size <UPLOAD_MAX_SIZE>;
|
||||
|
||||
location ^~ /data {
|
||||
@@ -66,11 +67,38 @@ http {
|
||||
try_files $uri $uri/ index.php;
|
||||
}
|
||||
|
||||
# Assets cache control
|
||||
# --------------------------------------
|
||||
location ~* \.(?:html|xml|json)$ {
|
||||
expires -1;
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js)$ {
|
||||
expires 7d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
location ~* \.(?:gif|jpe?g|png|ico|otf|eot|svg|ttf|woff|woff2)$ {
|
||||
expires 30d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
# PHP Backend
|
||||
# --------------------------------------
|
||||
location ~* \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param HTTP_PROXY "";
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:/tmp/php-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_intercept_errors on;
|
||||
fastcgi_request_buffering off;
|
||||
fastcgi_param REMOTE_ADDR $http_x_real_ip;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user