I am trying to serve legacy html website documents from the new site which is a wordpress site.
The new site is using nginx and I want to be able to serve files which are structured with a permalink like /articles/file-uri and the 10 years of legacy html static files from a directory in the root called legacy.
So, again, I want to try incoming request files against wordpress root and if the requested file is not found, search the legacy files for a static html article.. This works but it will not go back to legacy for the image files, javascript, etc ..
The location block below will serve a legacy page but not the images and javascript etc inside ... Any help would be very much appreciated. Thank you.
I have had some success with these blocks :
server_name myserver.com www.myserver.com;
access_log /var/log/nginx/myserver.com.access.log rt_cache_redis;
error_log /var/log/nginx/myserver.com.error.log;
root /var/www/myserver.com/htdocs;
index index.php;
location ^~ .php$ {
tryfiles $uri =404;
include fastcgiparams;
fastcgi_pass php74;
}
location / {
try_files $uri $uri/ /legacy$uri /legacy$uri/ /index.php$args;
}
include common/redis-php74.conf;
include common/wpcommon-php74.conf;
include common/locations-wo.conf;