0

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

6
  • Is this commented code or uncommented? Commented Nov 5, 2016 at 7:47
  • 1
    Edit your question and add the entire server block. Also, look at your access log and error log and post any relevant entries. What is the document root, the URI that fails and the correct location of the files? Commented Nov 5, 2016 at 9:45
  • Yes @RichardSmith let me edit this question Commented Nov 7, 2016 at 7:07
  • @satys I commented this because it was not working Commented Nov 7, 2016 at 7:07
  • As requested, edited the question with complete server block Commented Nov 7, 2016 at 7:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.