I am using Wordpress and when I add following, it breaks the page, it dont load any JS and CSS
server {
listen 80;
server_name domain.com;
client_max_body_size 20M;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://domainserver.com;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
error_page 404 =301 /;
# proxy_cache STATIC;
# proxy_cache_valid 200 1d;
# proxy_cache_bypass $cookie_nocache $arg_nocache$arg_comment;
# proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
}
location /ads/ {
proxy_pass http://domainserver.com;
proxy_cache STATIC;
proxy_cache_key "$proxy_host$uri$is_args$args";
proxy_cache_valid 30d;
proxy_cache_valid any 10s;
proxy_cache_lock on;
proxy_cache_use_stale error invalid_header timeout updating;
proxy_http_version 1.1;
expires 30d;
}
# location ~* \.(ico|css|js|gif|jpe?g|png)$ {
# expires 30d;
# add_header Pragma public;
# add_header Cache-Control "public";
# }
}
You can see the location block where I am trying to catch css|js etc
serverblock. Also, look at your access log and error log and post any relevant entries. What is the documentroot, the URI that fails and the correct location of the files?