Switching to nginx: php and rewrite rules from apache
Hello list, I'm moving a bunch of sites from Apache to nginx 1.5.13 :). Everything went fine for the static ones and for the sites under wp or joomla. I have one site in php developped by the customer that seemed ok till I discovered that it has a subdirectory with its own .htacess file. Trying to add the rewriting rules makes the php dead, only in the cited subdirectory. Here is my config: server { listen 212.45.144.216:80 default_server; server_name new.assirm.it test.assirm.it; access_log /dati/log/http/assirm/access.log; error_log /dati/log/http/assirm/error_new.log; rewrite_log on; #charset koi8-r; location ~ \.php$ { root /dati/httpd/web_assirm/sito_nginx; fastcgi_pass 127.0.0.1:9004; fastcgi_index index.php; include /etc/nginx/fastcgi.conf; } location / { root /dati/httpd/web_assirm/sito_nginx; index index.html index.htm index.php home.html welcome.html; #try_files $uri $uri/ /index.php?$args; rewrite ^/ultime-news.php$ /archivio-news.php?last=1 ; rewrite ^/(.*)_news(.*).htm$ /news.php?id=$2 ; rewrite ^/(.*)_ev(.*).htm$ /evento.php?id=$2 ; rewrite ^/(.*)_att(.*).htm$ /attivita.php?id=$2 ; rewrite ^/(.*)_k(.*).htm$ /pagina.php?k=$2 ; rewrite ^/(.*)_sk(.*).htm$ /stampa-contenuto.php?k=$2 ; rewrite ^/(.*)_sn(.*).htm$ /stampa-news.php?id=$2 ; rewrite ^/(.*)_a(.*).htm$ /associato.php?id=$2$args ; rewrite ^/(.*)_p(.*).htm$ /mypost.php?id=$2$args ; rewrite ^/ricerca-(.*).htm$ /risultati.php?s=$1goo=1 ; rewrite ^/privacy.php$ /pagina.php?k=privacy ; } location ^~ /en/ { rewrite ^/en/ultime-news.php$ /en/archivio-news.php?last=1 break; rewrite ^/en/(.*)_news(.*).htm$ /en/news.php?id=$2 break; rewrite ^/en/(.*)_ev(.*).htm$ /en/evento.php?id=$2 break; rewrite ^/en/(.*)_att(.*).htm$ /en/attivita.php?id=$2 break; rewrite ^/en/(.*)_k(.*).htm$ /en/pagina.php?k=$2 break; rewrite ^/en/(.*)_sk(.*).htm$ /en/stampa-contenuto.php?k=$2 break; rewrite ^/en/(.*)_sn(.*).htm$ /en/stampa-news.php?id=$2 break; rewrite ^/en/(.*)_a(.*).htm$ /en/associato.php?id=$2$args break; rewrite ^/en/(.*)_p(.*).htm$ /en/mypost.php?id=$2$args break; rewrite ^/en/(.*)_wit(.*).htm$ /en/wit.php?c=$2$args break; rewrite ^/en/ricerca-(.*).htm$ /en/risultati.php?s=$1goo=1 break; rewrite ^/en/privacy.php$ /en/pagina.php?k=privacy break; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } What did I have wrong? Many thanks to all, Luciano. -- /\ /Via A. Salaino, 7 - 20144 Milano (Italy) \ / ASCII RIBBON CAMPAIGN / PHONE : +39 2 485781 FAX: +39 2 48578250 X AGAINST HTML MAIL/ E-MAIL: posthams...@sublink.sublink.org / \ AND POSTINGS/ WWW: http://www.lesassaie.IT/ ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: Switching to nginx: php and rewrite rules from apache
On Sat, Jun 07, 2014 at 10:50:05AM +0200, Luciano Mannucci wrote: Hi there, I have one site in php developped by the customer that seemed ok till I discovered that it has a subdirectory with its own .htacess file. Trying to add the rewriting rules makes the php dead, only in the cited subdirectory. You use location (http://nginx.org/r/location) and rewrite (http://nginx.org/r/rewrite) with the break flag. Based on the documentation, I guess that you will want to include within your /en/ location, some configuration which tells nginx how you want php requests to be handled. What did I have wrong? You left out some useful information: * what request do you make? * what response do you get? * what response do you want? f -- Francis Dalyfran...@daoine.org ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: Switching to nginx: php and rewrite rules from apache
On Sat, 7 Jun 2014 10:08:54 +0100 Francis Daly fran...@daoine.org wrote: On Sat, Jun 07, 2014 at 10:50:05AM +0200, Luciano Mannucci wrote: Hi there, What did I have wrong? You left out some useful information: * what request do you make? new.assirm.it/en/ * what response do you get? The index.php page source. * what response do you want? The php interpreted result. Many thanks again, Luciano. -- /\ /Via A. Salaino, 7 - 20144 Milano (Italy) \ / ASCII RIBBON CAMPAIGN / PHONE : +39 2 485781 FAX: +39 2 48578250 X AGAINST HTML MAIL/ E-MAIL: posthams...@sublink.sublink.org / \ AND POSTINGS/ WWW: http://www.lesassaie.IT/ ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: website with login button, redirect to intranet?
Thanks :) I will give this a try :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250715,250722#msg-250722 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: Wiki updates -- was: Can anyone tell me how to delete spam pages on the wiki?
I'd like to also add my thanks. Great work. I think a very visible last updated date and the applies to section would be great. When I first started using nginx and the wiki, I found one thing a bit confusing. Clicking on a link on http://wiki.nginx.org/Modules directs you to the corresponding page on nginx.org/en/docs. While it's great to be directed to those docs, I expected to be taken to a wiki page on the core module. I would suggest some kind of notice that these links will take you to the nginx.org/en/docs site. The obsoleted pages are difficult. A link like this http://wiki.nginx.org/CoreModule#error_log in a google search bypasses the notice at the top so whoever's reading has no idea that the page has been obsoleted. I'm not registerd on the wiki so I don't know what editing options are availble to offer any suggestions for dealing with this. Terry Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250601,250725#msg-250725 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: arch linux , swf dir and forbidden error
Francis Daly Wrote: --- On Fri, Jun 06, 2014 at 11:57:22AM -0400, mfaridi wrote: Hi there, http://127.0.0.1/swf I see this error 403 Forbidden and I can not play sw game but when I type http://127.0.0.1/swf/pacman.swf every thing is good and I can flash game what is problem ? What does error_log say? Most likely there is no index.html file, or autoindex (http://nginx.org/r/autoindex) is not on, is my guess. f -- Francis Dalyfran...@daoine.org ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx when I type tail -f access.log I see these 127.0.0.1 - - [08/Jun/2014:02:39:03 +0430] GET /swf/ HTTP/1.1 403 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 127.0.0.1 - - [08/Jun/2014:02:39:04 +0430] GET /favicon.ico HTTP/1.1 404 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 127.0.0.1 - - [08/Jun/2014:02:40:00 +0430] GET /swf/ HTTP/1.1 403 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 127.0.0.1 - - [08/Jun/2014:02:40:27 +0430] GET /swf/ HTTP/1.1 403 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 127.0.0.1 - - [08/Jun/2014:02:41:24 +0430] GET /swf/ HTTP/1.1 403 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250709,250726#msg-250726 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: arch linux , swf dir and forbidden error
On Sat, Jun 07, 2014 at 05:05:46PM -0400, mfaridi wrote: Francis Daly Wrote: --- On Fri, Jun 06, 2014 at 11:57:22AM -0400, mfaridi wrote: Hi there, What does error_log say? Most likely there is no index.html file, or autoindex (http://nginx.org/r/autoindex) is not on, is my guess. 127.0.0.1 - - [08/Jun/2014:02:39:03 +0430] GET /swf/ HTTP/1.1 403 168 - Mozilla/5.0 (X11; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0 So the request you make is /swf/. The response you get is http 403. What response do you want to get? error_log might say why you get the 403 response. f -- Francis Dalyfran...@daoine.org ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
[ANN] OpenResty 1.7.0.1 released
Hi folks! I am happy to announce the new formal release, 1.7.0.1, of the OpenResty bundle: http://openresty.org/#Download Special thanks go to all our contributors for making this happen! Below is the complete change log for this release, as compared to the last formal release, 1.5.12.1: * upgraded the Nginx core to 1.7.0. * see the changes here: http://nginx.org/en/CHANGES * feature: bundled new Lua library, the lua-resty-lrucache library, which is also enabled by default. see https://github.com/openresty/lua-resty-lrucache#readme for more details. thanks Shuxin Yang for the help. * upgraded LuaJIT to v2.1-20140607: https://github.com/openresty/luajit2/tags * imported Mike Pall's latest bug fixes and features: * Fix frame traversal while searching for error function. * Fix FOLD rule for STRREF of SNEW. * FFI: Fix recording of indexing a struct pointer ctype object itself. * FFI: Another fix for cdata equality comparisons. * Fix FOLD rule for string.sub(s, ...) == k. * x86: Fix code generation for unused result of math.random(). * x64: Workaround for MSVC build issue. * PPC: Fix red zone overflow in machine code generation. * Fix compatibility issues with Illumos. Thanks to Theo Schlossnagle. * Add PS Vita port. Thanks to Anton Stenmark. * disabled trace stitching by default for now since it may trigger random lua stack corruptions when using with ngx_lua. * feature: jit.dump: output Lua source location after every BC. * feature: added internal memory-buffer-based trace entry/exit/start-recording event logging, mainly for debugging bugs in the JIT compiler. it requires -DLUA_USE_TRACE_LOGS when building. * feature: save g-jit_base to g-saved_jit_base before lj_err_throw clears g-jit_base which makes it impossible to get Lua backtrace in such states. * upgraded the lua-resty-core library to 0.0.7. * feature: implemented ngx.req.set_header() (partial: table-typed values not yet supported) and ngx.req.clear_header() with FFI in the resty.core.request module. * feature: implemented shdict:flush_all() with FFI in the resty.core.shdict. * feature: implemented ngx.req.set_method() with FFI in resty.core.request. * feature: implemented ngx.req.get_method() with FFI in resty.core.request. * feature: implemented ngx.time() with FFI in resty.core.time. * feature: implemented ngx.req.start_time with FFI in rest.core.request. * feature: implemented ngx.now() with FFI in resty.core.time. * upgraded the ngx_lua module to 0.9.8. * bugfix: the ngx.ctx table might be released prematurely when ngx.exit() was used to generate the response header. thanks Monkey Zhang for the report. now we always release ngx.ctx in our request pool cleanup handler. * bugfix: we did not call our coroutine cleanup handlers right after our coroutine completes (either successfully or unsuccessfully) otherwise segmentation fault might happen when the Lua VM throws out unexpected exceptions like attempt to yield across C-call boundary. thanks Lipin Dmitriy for the report. * bugfix: nginx does not guarentee the parent pointer of the rbtree root is meaningful, which could lead to inifinite loops when the ngx_lua module tried to abort pending timers prematurely (upon worker exit). thanks pengqi for the report. * bugfix: ngx.req.set_method(): we incorrectly modified r-method when the method ID was wrong. * bugfix: rewrite_by_lua* and access_by_lua* will now terminate the current request if the response header has already been sent (via calls like ngx.say and ngx.send_headers) at that point. thanks yaronli and Sophos for the report. * bugfix: issues in the error handling for pure C API functions for shared dict. thanks Xiaochen Wang. * feature: now we save the original pattern string pointer value into our ngx_http_lua_regex_t C struct, to help runtime regex profiling and debugging. * feature: allow use of 3rd-party pcre bindings in init_by_lua*. thanks ikokostya for the feature request. * feature: added pure C API functions to support the new FFI-based Lua API implemented in the lua-resty-core library. * feature: make use of the new shm API in nginx 1.5.13+ to suppress the no memory error logging when the shared dictionaries run out of memory. * feature: added C macro NGX_LUA_ABORT_AT_PANIC to allow
ANN: HTTP 1.1 is now RFC 7230 to RFC 7235
Dear Readers. Today I haven seen the following post on the curl-lib mailing list which I want to share. http://curl.haxx.se/mail/lib-2014-06/0073.html # Zite Finally, RFC 2616 is deprecated and HTTP 1.1 is now offically instead done in the whole range of new RFCs in the subject. This revision work has taken almost seven years to complete. # In the new rfcs are always a section Changes from RFC 2616 and in the last one 7235 is it Changes from RFCs 2616 and 2617 Best regards Aleks ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx