Hi Niphlod, once I discovered that making a symbolic link for each language
in the app directory pointing to the app directory worked well.
Namely something like that app_dir/it ---> app_dir . However  it would be
better to find something cleaner but for that I have to look at nginx but
right now I don't access to the virtual machine.
I guess we can add a new directive for serving static files with language
in url. will it works?
Paolo


2013/1/22 Niphlod <niph...@gmail.com>

> got it. can you post the routes.py you're using ?
>
> The problem lies in the fact that routes.py is really flexible and
> adapting that logic using only rewrite or alias statements in nginx is
> cumbersome.
> Standing on one feet (i.e. without tests) I'd say that the regex checking
> static files
>
>         location ~* /(\w+)/static/ {
>             root /home/www-data/web2py/applications/;
>             #remove next comment on production
>             #expires max;
>         }
>
> is catching it as the app name and not the language "trick" . so, for a 
> request going to /it/app/static/whatever.css is looking into
>
> /home/www-data/web2py/applications/*it/*appname/static/whatever.css instead 
> of  ..... (remove the bold part, "*it/*").
>
> If you remove those lines web2py will take charge for static files
> serving, so the issue will be temporarily fixed.
>
> I'll try to set up some additional rules to make nginx behave like
> routes.py, but it will take some time.
>
> PS: please mind that the script it's a template.... it's not meant to
> fullfill every custom installation patterns out there without further
> tuning.
> language routing is probably the most difficult out there because for a
> request
> /it/appname/static/whateverfile.css
> web2py looks into /web2py/appname/static/it/whateverfile.css and then if
> not found into /web2py/appname/static/whateverfile.css (a nice fallback,
> but hard to map with a simple nginx statement)
>
>
> On Tuesday, January 22, 2013 6:14:55 PM UTC+1, Paolo valleri wrote:
>
>> Hi Massimo, for example, if I visit this traffic.integreen-life.bz.it/**
>> default/wiki/about<http://traffic.integreen-life.bz.it/default/wiki/about> 
>> (default is the controller and wiki is the function) it works while
>> traffic.integreen-life.bz.it/**it/default/wiki/about<http://traffic.integreen-life.bz.it/it/default/wiki/about>the
>>  application works very well but the static links do not.
>>
>> Paolo
>>
>>
>> 2013/1/22 Massimo Di Pierro <massimo....@gmail.com>
>>
>> can you show an example?
>>>
>>>
>>> On Tuesday, 22 January 2013 07:36:39 UTC-6, Paolo valleri wrote:
>>>
>>>> Hi all, I've just discovered that the regex used to retrieve the static
>>>> files doesn't work if I use languages abbreviation in urls.
>>>> How can we fix this?
>>>>
>>>>
>>>>
>>>> 2012/12/28 Richard Vézina <ml.richa...@gmail.com>
>>>>
>>>>>  Hello,
>>>>>
>>>>> I publish a new script that allow deployment of Redmine beside web2py.
>>>>>
>>>>> Here : https://groups.google.com/**fo**rum/?fromgroups=#!searchin/**
>>>>> web**2py/redmine/web2py/**ZqL7Si8Khbo**/Es-wK1yXdgQJ<https://groups.google.com/forum/?fromgroups=#!searchin/web2py/redmine/web2py/ZqL7Si8Khbo/Es-wK1yXdgQJ>
>>>>>
>>>>> Notice : After some read, I choose Unicorn over Phussion Passenger.
>>>>>
>>>>> Richard
>>>>>
>>>>>
>>>>> On Thu, Dec 20, 2012 at 9:57 AM, Massimo Di Pierro <
>>>>> massimo....@gmail.com> wrote:
>>>>>
>>>>>> please email me the patch of latest file when ready for inclusion.
>>>>>>
>>>>>>
>>>>>> On Thursday, 20 December 2012 03:18:20 UTC-6, Niphlod wrote:
>>>>>>>
>>>>>>> perfect, Ccing Massimo on this final one.
>>>>>>>
>>>>>>> Il giorno giovedì 20 dicembre 2012 00:16:25 UTC+1, Paolo ha scritto:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>> I was trying with the script that comes with the stable web2py.
>>>>>>>> with the one on dropbox I problem has gone.
>>>>>>>>
>>>>>>>> Paolo
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/12/19 Niphlod <nip...@gmail.com>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> @Simone, an other improvement to the script could be to combine
>>>>>>>>>> into a single server the 80, and 443 to avoid duplicating 
>>>>>>>>>> configuration, as
>>>>>>>>>> stated here :
>>>>>>>>>> http://nginx.org/en/docs/http/********configuring_https_servers.*
>>>>>>>>>> *html******#single_http_https_server<http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server>
>>>>>>>>>> I don't had test this.
>>>>>>>>>>
>>>>>>>>>> Also, here the code for permanent redirection
>>>>>>>>>> server {
>>>>>>>>>>   server_name $hostname;
>>>>>>>>>>   listen              80;
>>>>>>>>>>   return 301 http*s*://$hostname$request_uri; # NOTE: I am not
>>>>>>>>>> sure for $hostname here, because I didn't set hostname for my VM 
>>>>>>>>>> until now,
>>>>>>>>>> as in the example (URL below) we can use domainName.com instead if 
>>>>>>>>>> properly
>>>>>>>>>> configure in nginx
>>>>>>>>>> ...
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> People may want separate configs for http and https. The script
>>>>>>>>> objective is to have a working copy of web2py. If we start to follow 
>>>>>>>>> such
>>>>>>>>> requests, we'd end up installing postgresql and redis too :P
>>>>>>>>>
>>>>>>>>> @Paolo: try the script found at the dropbox link. If the same
>>>>>>>>> error happens I think we need the log of pip and a hand by Roberto on 
>>>>>>>>> the
>>>>>>>>> specific error...
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>  Paolo
>>>>>>>>
>>>>>>>  --
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>  Paolo
>>>>
>>>  --
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>>  Paolo
>>
>  --
>
>
>
>



-- 
 Paolo

-- 



Reply via email to