Browse Source

+ uploads_upstream conf

master
Paul 2 years ago
parent
commit
9fab9307b6
  1. 6
      config/nginx/conf.d/vhosts.conf.example
  2. 112
      config/nginx/conf.d/z-wordpress.conf.example

6
config/nginx/conf.d/vhosts.conf.example

@ -17,6 +17,12 @@ map $http_accept $webp_suffix {
"~*webp" ".webp";
}
resolver 8.8.8.8;
map $http_host $uploads_upstream {
wordpress.ru.local.wpstudio.ru "https://somewp.site";
}
server {
server_name
octobercms.ru.local.wpstudio.ru

112
config/nginx/conf.d/z-wordpress.conf.example

@ -1,67 +1,63 @@
server {
server_name
wp-with-file-proxy.local.wpstudio.ru
;
listen 80;
root $root;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^/wp-content/uploads/.*$ {
expires max;
proxy_pass $uploads_upstream;
}
location ~* ^/uploads/.*$ {
expires max;
proxy_pass $uploads_upstream;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
server_name
wp-with-file-proxy.local.wpstudio.ru
;
listen 80;
root $root;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^/wp-content/uploads/.*$ {
expires max;
proxy_pass $uploads_upstream;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass fpm74;
fastcgi_index index.php;
fastcgi_read_timeout 3000;
}
fastcgi_pass fpm74;
fastcgi_index index.php;
fastcgi_read_timeout 3000;
}
}
server {
server_name
wp.local.wpstudio.ru
;
listen 80;
root $root;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
server_name
wp.local.wpstudio.ru
;
listen 80;
root $root;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass fpm74;
fastcgi_index index.php;
fastcgi_read_timeout 3000;
}
fastcgi_pass fpm74;
fastcgi_index index.php;
fastcgi_read_timeout 3000;
}
}
Loading…
Cancel
Save