Well ... it seems that $uri is what I was looking for: # ... = snip of extensions for readability purposes location ~* ^(.*\.[^.]*)(jpg|jpeg|gif|png|...|woff|ttf|svg)(\?.*)?$ { try_files $uri @apache; } I expanded the regexp a bit to be sure that I'm matching the text after the last dot in the uri. Hope this helps somebody.by compiler2k - How to...
Hi all... Auto-update. I found this: # http://blog.bripkens.de/2012/03/nginx-cache-busting/ server { # ... location ~* ^/static/(\w+)/([^/]+)_\d+\.(js|css|png|jpg|jpeg|gif|ico)$ { alias /srv/www/static/$1/$2.$3; add_header Vary Accept-Encoding; expires max; } # ... } The problem is that if /srv/www/static/$1/$2.$3 does not exist, I lose the fallback toby compiler2k - How to...
Hi all. I'm adding an nginx in front of an Apache webserver. The idea is to serve static content with nginx and dynamic content with Apache. I've moved Apache to port 8080 and created the following nginx configuration: # ... = snip of extensions for readability purposes location ~* \.(jpg|jpeg|gif|png|ico|css|...|js|htm|html)$ { try_files $request_uri @apache; }by compiler2k - How to...
Hi. I have a Linux Ubuntu 8.04 LTS machine with nginx 0.7.62-0 installed from a PPA repository. NGINX is being working correctly since now, but today I've tried to add the 33th "virtualhost" to the sites-available and sites-enabled/ directory and nginx does not start. I have 32 working virtualhosts from 000-virthost1 to 031-virthost31, but when I try to add 032-virthost (theby compiler2k - Nginx Mailing List - English
Just by checking for the existence of the X-Forwarded-For header: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" proxiedby compiler2k - How to...
> > 2.- Why apache does not show the real IP of the > > request, instead of nginx's 127.0.0.1 origin IP? > Probably you are not running Apache with mod_rpaf - see http://stderr.net/apache/rpaf/. > If you google nginx + mod_rpaf you will probably find several tutorials with the details. No, I'm not using mod_rpaf. But I managed to log the real IP address just with &qby compiler2k - How to...
Hi. I tested your suggestions with the following code: location ~* ^.+.(jpg|jpeg|gif|png|ico|(and so on)|htm|html)$ { root /var/www; try_files $request_uri $request_uri/ @backend; } location @backend { proxy_pass http://127.0.0.1:81; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; } # Scripts en PHP:by compiler2k - How to...
Thanks a lot for the answer, I'll check it tomorrow, but it seems that is exactly what I was looking for. Just an extra question: Is it possible that nginx logs all the requests served? I want to use awstats with the log files and with proxypass I have the hits in 2 separate log files (apache's log and nginx's log). I need all the access to be registered in a single log file so that I can passby compiler2k - How to...
Hi. I'm trying to serve EXISTING static files with nginx and proxy_pass-ing all the other file extensions (including .php) of EZPUBLISH to Apache on port 81. I wrote the following config: # If file exists in /var/www and is static, serve it directly: location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|doc|xls|pdf|ppt|txt|tar||js|htm|html)$ { if (-f $request_filenaby compiler2k - How to...