Currently, I'm trying to mirror a WordPress website, but getting some issues with nginx. The files (specifically js and css) are saved with ?ver=key on the end of the files so when nginx tries to serve them it serves a 404 error.
Here is an example file:
wp-embed.min.js?ver=cce7ff2a6851b83ee00fd3873407f90c
How can I have nginx serve this file without giving a 404 error? I do not want to rename all these files as there are thousands of them. Here's my nginx config:
server {
server_name [redacted];
root /home/[redacted];
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/[redacted]/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/[redacted]/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = [redacted]) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name [redacted]
listen 80;
listen [::]:80;
return 404; # managed by Certbot
}
html/cssorjavascriptstackoverflow.com/help/tagging