Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im using Nginx as FrontEnd Server, and behind it a Apache Http Server and begind it a Glassfish Application Server :) My problem is, when i need a static context like;

"http://127.0.0.1:8077/directory-web/resources/defaultTheme/images/facebook.png;jsessionid=07ab5b915530738297010cbc0b5c.worker1"

when i request to "http://127.0.0.1:8077/directory-web/resources/defaultTheme/images/facebook.png" link, image returns me, but nginx doesnt know what is JSESSIONID.

In production, Glassfish will be in two cluster. Thanks.

share|improve this question
1  
What do you mean by "nginx doesnt know what is JSESSIONID"? What problem are you having - what does nginx need to do with the JSESSIONID? –  Shane Madden Jul 22 '12 at 21:52
    
Path to facebook.png is ; 127.0.0.1:8077/directory-web/resources/defaultTheme/images/… (this ok), but do you know a path like this ....eme/images/facebook.png;JKDFBJDBVD ?? 404 STATUS CODE TURNS me by Nginx, coz its not a path only a cookie –  Rahman Usta Jul 23 '12 at 4:36
    
It shouldn't care what path it's proxying - how is your nginx configured? –  Shane Madden Jul 23 '12 at 6:05
    
chopapp.com/#5pwm5dcf –  Rahman Usta Jul 23 '12 at 6:56
    
in html directory static files stands. but, facebook.png;jsessionid=07ab5b915530738297010cbc0b5c.worker1" is not a file name –  Rahman Usta Jul 23 '12 at 6:57

1 Answer 1

up vote 1 down vote accepted
location ~* ^(.+\.(?:jpe?g|gif|css|png|js|ico))(?:;.+)?$ {
    try_files $1 =404;
    access_log off;
    expires max;
}
share|improve this answer
    
you except all static resource, but i need only except ;jsessionidblablabla –  Rahman Usta Jul 23 '12 at 19:47
    
location ~* ^(.+\.(?:jpe?g|gif|css|png|js|ico));jsessionid= { –  VBart Jul 23 '12 at 20:17
    
but, it must accept jpeg,gif,css,png,js and ico for example : xx.png and xx.js?fgdfgjd but it shouldnt accept xx.png;jsessionbdljgdno –  Rahman Usta Jul 24 '12 at 13:00
    
I'm totally confused. And what do you mean by it must accept? –  VBart Jul 24 '12 at 13:08
    
1. ^(.+\.(?:jpe?g|gif|css|png|js|ico))(?:;.+)?$ - matches jpeg,gif,css,png,js and ico with or without ;something at the end. 2. ^(.+\.(?:jpe?g|gif|css|png|js|ico));jsessionid= matches jpeg,gif,css,png,js and ico only with ;jsessionid= at the end. 3. \.(?:jpe?g|gif|css|png|js|ico)$ - matches jpeg,gif,css,png,js and ico only without anything at the end. –  VBart Jul 24 '12 at 13:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.