Never mind, Nginx was actually limiting requests correctly. What I was seeing in my logs was requests for non-existent .js and .css files, which were then being passed to index.php as per my try_files in the / location block.by djeyewater - Nginx Mailing List - English
I have a location ~* \.php$ with limit_req set inside it. But requests outside of this location block, e.g. for .js and .css files are also being limited. I only want to limit the number of requests to .php files. This is my config: worker_processes 2; pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stby djeyewater - Nginx Mailing List - English
B.R. Wrote: ------------------------------------------------------- > You should use limit_conn > <http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#limit_c > onn> > in conjunction with limit_req > <http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_re > q>. > They are supplementing each other. > --- > *B. R.* > >by djeyewater - Nginx Mailing List - English
itpp2012 Wrote: ------------------------------------------------------- > No because one user (web browser) can easily open 20 or more > simultaneous connections to get a better web response. > A bot might be less prone to do the same but most connect at about 5 > simultaneous connections. The limit_req will only be used for requests to dynamic pages, so there should only beby djeyewater - Nginx Mailing List - English
I want to limit requests to 1 per second for each user, counting a bot that makes requests from multiple ips as a single user. Does this make sense: map $http_user_agent $single_user { default $binary_remote_addr; ~PaperLiBot 1; } limit_req_zone $single_user zone=one:10m rate=1r/s; ... limit_req zone=one burst=2; Thanks Daveby djeyewater - Nginx Mailing List - English
Thanks Maxim, the perl_modules work around works well.by djeyewater - Nginx Mailing List - English
When I try to start nginx with embedded perl I get the error "Can't locate nginx.pm in @INC" @INC includes the folder I specified using --with-perl_modules_path, but doesn't include the arch-name subfolder (i386-linux-thread-multi), which is where the nginx.pm module was installed to. This is my configure: ./configure --prefix=$HOME/apps/$NGINX \ --with-pcre=$HOME/tarballs/$PCREby djeyewater - Nginx Mailing List - English
Thanks for the explanation, makes sense to me now. Daveby djeyewater - Nginx Mailing List - English
I'm trying to get a maintenance page working for my site. I added the following to the server block: error_page 503 /maintenance.html; return 503; This serves 503 but with default nginx 503 error page. The following works okay, but I don't understand why the above doesn't show the custom 503 page? error_page 503 @503; return 503; location @503 { try_files /maintenance.html =503;by djeyewater - Nginx Mailing List - English
Hmm.. well I installed the latest version and found that actually nothing is being zipped. Was probably the same thing before, but most of the static files have gzip versions and so were included by gzip_static, making it look like only PHP wasn't being zipped. Any ideas?by djeyewater - Nginx Mailing List - English
Thanks for testing it MagicBear. Google Chrome reports content type header as: Content-Type:text/html; charset=UTF-8 So still not sure why it is not working. I checked nginx changelog and couldn't see anything that looked to be pointing out that this was an issue in older versions of nginx. Still, I will try latest stable version and see if that makes any difference. Daveby djeyewater - Nginx Mailing List - English
Nginx isn't gzipping php pages, but I don't know why? I'm using the Audits tab in Google Chrome Developer tools to determine that the pages aren't being gzipped. My config: nginx version: nginx/0.8.52 built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) configure arguments: --prefix=/home/djeyewater/apps/nginx --with-pcre=/home/djeyewater/tarballs/pcre-8.10 --without-http_autoindex_module --without-hby djeyewater - Nginx Mailing List - English
With php 5.3.3, when I used ps to view the info for the main php-fpm process, ps -o cmd (or args) would output /path/to/php/sbin/php-fpm But with php 5.3.4, instead I get php-fpm: master process (/path/to/php/etc/php-fpm.conf) I need to make sure the php-fpm I'm viewing the info for in ps is one in a specific location. This is difficult if the path isn't displayed in ps. Can anyone advise me onby djeyewater - Php-fpm Mailing List - English
--with-ld-opt="-Wl,-R,$HOME/apps/GeoIP/lib -L $HOME/apps/GeoIP/lib" worked Thanks for the help! Daveby djeyewater - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > > Then try: > > --with-ld-opt="-rpath $HOME/apps/GeoIP/lib -L > $HOME/apps/GeoIP/lib" > Unfortunately that's the same (from autoconf.err): checking for --with-ld-opt="-rpath /home/djeyewater/apps/GeoIP/lib -L /home/djeyewater/apps/GeoIP/lib" gcc: unrecognized option 'by djeyewater - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > What is in objs/autoconf.err near this test ? Hi Igor objs/autoconf.err has checking for --with-ld-opt="-R /home/djeyewater/apps/GeoIP/lib -L /home/djeyewater/apps/GeoIP/lib" gcc: unrecognized option '-R' /home/djeyewater/apps/GeoIP/lib: file not recognized: Is a directory collect2: ld returnby djeyewater - Nginx Mailing List - English
Igor Sysoev Wrote: > Try > > --with-ld-opt="-R $HOME/apps/GeoIP/lib -L > $HOME/apps/GeoIP/lib" > Unfortunately I get the following error when running configure with that: ./configure: error: the invalid value in --with-ld-opt="-R /home/djeyewater/apps/GeoIP/lib -L /home/djeyewater/apps/GeoIP/lib" Daveby djeyewater - Nginx Mailing List - English
I have the GeoIP lib installed in a non standard location. I am configuring nginx like ./configure --prefix=$NGX_PATH --with-pcre=$HOME/tarballs/pcre-8.10 --without-http_autoindex_module --without-http_charset_module --without-http_empty_gif_module --without-http_geo_module --without-http_ssi_module --with-http_gzip_static_module --with-http_realip_module --with-http_geoip_moduby djeyewater - Nginx Mailing List - English
Alexander Vogt Wrote: ------------------------------------------------------- > Check your max_execution_time (have a look at the > memory limits aswell) in > php.ini to make sure PHP itself does not trigger a > timeout. You should also > make sure that your script does not use output > buffering (and also disable > output buffering in php.ini), and it flushes itsby djeyewater - Nginx Mailing List - English
I have a PHP script that processes a folder of images, it takes quite a while to do this, but should produce output as it goes along. But when running this script I get a 504 Timeout, probably after 60s. The script also appears to stop running, so I end up with some database records written, and others not. (Does nginx send a signal to the fastcgi process to tell it to stop what it's doing and getby djeyewater - Nginx Mailing List - English
I have a php script that uses ImageMagick to process an image. What I'd like to do is to flush the buffers just before the script calls ImageMagick, that way the user at least gets some output in their browser instead of getting an empty page until ImageMagick has done its stuff (which takes a while). At the moment I'm using a test page to simulate the above situation: <?php ini_set('zlibby djeyewater - Nginx Mailing List - English
proforg Wrote: ------------------------------------------------------- > Probably you need to examine PHP logs (or even > spawn-fcgi logs/output > to stderr) - problem should be clearly visible > there. There are really > lots of reason for PHP to die :) I added the following to my php.ini: log_errors = on error_log = /home/djeyewater/logs/php-errors.log and modifiby djeyewater - Nginx Mailing List - English
This isn't really an Nginx problem, but hopefully someone can help me. I'm running PHP as fcgi using spawn-fcgi. I have a PHP script that resizes an image, but when I try to access this page, it seems to get partway through processing the page, then the PHP process handling the request dies. I receive in the browser the output of the script as far as it got, and in the error log I get: 2010/by djeyewater - Nginx Mailing List - English
Fixed it now - I had copied the proxy syntax from the nginx.conf.default example of proxying to apache, but it seems that the following lines are also needed in the conf for Nginx on port 80, otherwise the Nginx listening on the other port doesn't receive the domain being accessed: proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Forby djeyewater - Nginx Mailing List - English
I'm trying to setup nginx as a front-end receiving requests on port 80, and then forwarding them to another nginx installation listening on a different port. The Nginx on port 80 is working okay, I opened up http://localhost/ and got the 'Welcome to Nginx' message. The Nginx on port 7776 is working okay, I opened up http://static1.photosite.com:7776/js-min.js and got the page loaded okay. Bby djeyewater - Nginx Mailing List - English