> Exact locations are faster. Thanks again. We will go with exact locations. :-)by rahul286 - Nginx Mailing List - English
@Igor Few Updates: > location = old-url-1 { return 301 new-url-1; } is really nice. We can specify 301/302 using it. But I am reading - http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_valid and now I am thining weather to populate config file with 1000's of lines like below (using automated script, no human efforts involved) > location = old-url-1 { reby rahul286 - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > location = old-url-1 { return 301 new-url-1; } Bingo! Never thought of this. :-) We will use this for https://github.com/rtCamp/easyengine/issues/162 Thanks a lot. :-)by rahul286 - Nginx Mailing List - English
Hi All, I am just wondering, say for 1000 url redirects, what will be more efficient. Rewrite Style: ============ server { rewrite old-url-1 new-url-1 permanent; rewrite old-url-2 new-url-2 permanent; rewrite old-url-3 new-url-3 permanent; #.... rewrite $old-url-1000 $new-url-1000 permanent; }by rahul286 - Nginx Mailing List - English
Congrats Igor and Nginx team. :-) It just matter of time before Nginx becomes #1 in Top 10,000 and eventually #1 overall. Most cheap hosting companies are run by non-techie people (using resellers tool) who don't understand benefit of Nginx and/or do not have control on server softwares!by rahul286 - Nginx Mailing List - English
@Jonathan Thanks again for your inputs. This thread helped me learn few more things. :-) Apart from that, I think, an application like web-based control-panel - built for Nginx specially, will anyway need take care of all this. Technically, if a script can write to a file and have new config updated automatically, it will have to handle security issue as well.by rahul286 - Nginx Mailing List - English
Thanks for suggestion André. :-) Yes, we will take whitelisting approach only. Rather than giving direct command like "nginx -t && service nginx reload" in sudoers list, we will create a small shell script, put it outside web-writable path (so php/web-scripts cannot alter it) www-data user will have sudo privilege on our script onlyby rahul286 - Nginx Mailing List - English
By the way more details about problem we are trying to solve are here - https://github.com/rtCamp/nginx-helper/issues/9 Another approach is to add PHP user to sudoers list and allow them to execute only one command "www-data ALL=NOPASSWD: nginx -t && service nginx reload" Again, other PHP script adding unwanted code can not be rules out!by rahul286 - Nginx Mailing List - English
Thanks for a really scary example! :D By the way, I was NOT planning this for shared environment. In fact for a wordpress blog-network which use our plugin http://wordpress.org/extend/plugins/nginx-helper/ Whenever users create new sites, the plugin add new sites id in map.conf file (simple key value pair table of domain-name and numeric-ids for efficient file-handling) I was thinkingby rahul286 - Nginx Mailing List - English
Thanks for warning. :-) I guess a serious threat will be present when a malicious code injects perl scripts via nginx config... Then request to some path will trigger perl script (which can be a backdoor, destruction program)by rahul286 - Nginx Mailing List - English
First, we can use "watch/monitor" files in linux for changes and execute some command based on it. Now, for a site lets put a ".nginxaccess" file to hold site specific configuration (file will be writable by PHp, etc so web-site can update it) Then we can put in main site config "include $documentroot/.nginxaccess" And also start a daemon to watch "/var/by rahul286 - Nginx Mailing List - English
With reference to: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_path file names in a cache looks like this: /data/nginx/cache/c/29/b7f54b2df7773722d382f4809d65029c Is there any way to use different scheme for this, for example: /data/nginx/cache/$http_host/$request_uri/ === Reason: With reference to http://nginx.org/en/docs/http/ngx_http_fastcgi_modby rahul286 - Nginx Mailing List - English
Thanks again for more details. For better compatibility, I will use "P" everywhere. :-)by rahul286 - Nginx Mailing List - English
Yep. When using values across lines, I noticed overwriting. One last question: I think using "P" in named capture e.g. "?P<blogpath>" is old style. But even on nginx 1.2 also some people get error: "pcre_compile() failed: unrecognized character after". It goes away when they update PCRE lib. For better compatibility, is it good idea to use "P"by rahul286 - Nginx Mailing List - English
Igor Sysoev Wrote: ------------------------------------------------------- > Digit captures are not supported in map. You have to use named capture. Thanks for clarification :-) Is map exception or there are other directives also which do not support Digit captures? I ran into issues in if-location block (mostly an If-evil case). I switched to named capture and it worked nice.by rahul286 - Nginx Mailing List - English
Sorry for wrong question. I wanted to ask... map "~ ^/~([^/]*)/.*$)" $userhome{ } style regex. Where map input string will be $1. === Apart from that, inside map: map $uri $blogname{ ~^(?P<blogpath>/[^/]+/)files/(.*)$ $blogpath ; } I am not able to use $1. I always have to use a variable like $blogpath. Is it by design or a mistake on my end? Iby rahul286 - Nginx Mailing List - English
I will debug my config again. Thanks. By the way, does map support regex in input parameter? Now or in future?by rahul286 - Nginx Mailing List - English
I am using Nginx 1.2.4 So a line like "map $http_host$uri $blogid" is valid one?by rahul286 - Nginx Mailing List - English
I have a case where I need to use Nginx map in slightly different way. I use following to create a variable $blogpath `map $uri $blogname{ ~^(?P<blogpath>/[_0-9a-zA-Z-]+/)files/(.*) $blogpath ; }` Next, I want to run another map using: `map $http_host$blogpath $blogid{ #map lines }` Problem is - map doesn't support 2 input parameters. It thrby rahul286 - Nginx Mailing List - English
@All For records, I managed to fix this myself. Solution posted here: http://serverfault.com/questions/178671/nginx-php-fpm-504-gateway-time-out-error-with-almost-zero-load-on-a-test-se/179136#179136by rahul286 - How to...
My colleague Shahzad already sent you some info. I have posted over 30 tutorials. See: http://rtcamp.com/wordpress-nginx/tutorials/ We have moved 100's of sites in last 3 years from Apache to Wordpress. I will recommend filling this questionnaire: http://rtcamp.com/wordpress-nginx/questionnaire/ We will send you a proposal for free.by rahul286 - Requests for Paid Services
@Igor Wish u happy birthday... :-)by rahul286 - Nginx Mailing List - English
Thanks Joshua. :-) Got it working directly. It turned out to be easier than I thought. Only thing complicated was no support for something like fastcgi_cache_purge in core I need to remove official nginx & go through recompilation with https://github.com/FRiCKLE/ngx_cache_purge I hope someday, something like this will be part of Nginx core...by rahul286 - Nginx Mailing List - English
Hi All, I use Nginx on many sites and recently I thought to make use of fastcgi_cache to capture response of PHP-FPM. I want to put it in RAM (We have 32GB RAM. More than 50% of it is free) I am confused as some article suggests - declaring "open_file_cache" before we can make use of fastcgi_cache. Can't I directly use fastcgi_cache on /run/cache ? Please suggest.by rahul286 - Nginx Mailing List - English
Wow! This is really a great news. This move will definitely bring more users in our community since many times not-so-techie users prefer to go with commercially supported software. I hope your Nginx venture will provide commercial support & services. You can also partner with some hosting companies for extra revenue. We started a dedicated portal ( http://wpnginx.com/ ) for wordpress-nginxby rahul286 - Nginx Mailing List - English
@minaev & Jerome How listen.backlog works? My issues is solved but I would prefer to have some extra knowledge. ;-) Thanks All, -Rahul :-)by rahul286 - Nginx Mailing List - English
minaev Wrote: ------------------------------------------------------- > Do you have request_terminate_timeout defined in > your php-fpm.conf? No. I hope this will solve the problem. Thanks. :-)by rahul286 - Nginx Mailing List - English
Hi All, After debugging for 6-hours - I am giving this up :| We have a nginx+php-fpm+mysql in LAN with almost 100 wordpress (created and used by different designers/developers all working on test wordpres setup) We are using nginx without any issues from long. Today, all of a sudden - nginx started returning "504 Gateway Time- out" out of the blue... I checked nginx error log for aby rahul286 - Php-fpm Mailing List - English
Can anyone please tell me if I should check nginx OR php-fpm for the issues? -Rahul :| -- Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd. Mobile: +91-9860501882 | Web: http://rtcamp.com/ On Tue, Sep 7, 2010 at 11:09 AM, rahul286 <nginx-forum@nginx.us> wrote: > (note - this is reposting of - > http://forum.nginx.org/read.php?11,127694) > > Hi All, > > Aftby rahul286 - Nginx Mailing List - English
(note - this is reposting of - http://forum.nginx.org/read.php?11,127694) Hi All, After debugging for 6-hours - I am giving this up :| We have a nginx+php-fpm+mysql in LAN with almost 100 wordpress (created and used by different designers/developers all working on test wordpres setup) We are using nginx without any issues from long. Today, all of a sudden - nginx started returning &by rahul286 - Nginx Mailing List - English