Welcome! Log In Create A New Profile

Advanced

Trying to add expires on proxied content make images and css/js redirect

Jose de Paula Eufrasio Junior
November 04, 2009 02:28AM
So, I have this config here:

       location /thelocation {
           if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)$") {
               expires 15d;
               break;
           }
           proxy_set_header Host xxxxxxxxr;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_pass http://localhost:8080/thelocation;

       }

The thing is, I am getting redirects on images and css, some example
pieces of the headers:

I send
GET /thelocation/wp-content/plugins/contact-form-7/stylesheet.css HTTP/1.1


and I get:
HTTP/1.x 301 Moved Permanently

Location: http://xxxxxxxxxxxxxxxx/thelocation/thelocation/wp-content/plugins/contact-form-7/stylesheet.css/


As you can notice, it redirects to my location twice and with a / on the end.
If I remove the "if" part of the server location configuration,
everything works ok. This location is served by a wordpress that is
behind varnish. I also have gzip enabled on nginx.

Any help is welcome.

--
José de Paula Eufrásio Júnior (coredump)
MCSO, GRC Professional
http://core.eti.br
Subject Author Posted

Trying to add expires on proxied content make images and css/js redirect

Jose de Paula Eufrasio Junior November 04, 2009 02:28AM

Re: Trying to add expires on proxied content make images and css/js redirect

Piotr Sikora November 04, 2009 04:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 292
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready