I've setup a proxy NGINX that access a Wordpress server on 10.0.0.151:
#
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
server {
server_name judith.com www.judith.com *.judith.com;
return 301 https://www.judith.com$request_uri;
}
server {
listen [::]:443 ssl;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/judith.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/judith.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
server_name judith.com www.judith.com *.judith.com;
location / {
proxy_pass http://10.0.0.151;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {
root http://10.0.0.151;
access_log off;
expires max;
}
client_max_body_size 2000M;
}
When going to https://www.judith.com I can access the web page, get the certification (trusted page) and show the page, but without all static content (images, css, etc.).
How to make it properly show all static content (js, css, images, etc)?
Sure I'm missing something simple... Help appreciated.