[Flask] URL rewriting (url_for) issues with Flask 0.11.1 and fastcgi

Erik Lindqvist eriksmejl at gmail.com
Thu Oct 13 09:28:12 EDT 2016


Basically a copy of the fastcgi example from the docu, minus the port
binding:
$SERVER["socket"] == ":5000" {
    fastcgi.server = ("/yourapplication.fcgi" =>
       ((
            "socket" => "/tmp/tti-app-fcgi.sock",
            "bin-path" => "/local/www/wwwroot/yourapplication/
yourapplication.fcgi",
            "check-local" => "disable",
            "max-procs" => 1
        ))
    )
  alias.url = (
      "/static/" => "/local/www/wwwroot/yourapplication/static"
  )
  url.rewrite-once = (
      "^(/static($|/.*))$" => "$1",
      "^(/.*)$" => "/yourapplication.fcgi"
  )
}


On Thu, Oct 13, 2016 at 1:52 PM, Sébastien Billion <
sebastien.billion at gmail.com> wrote:

> Can we see your lighthttpd conf file?
>
> 2016-10-13 11:21 GMT+02:00 <badrihippo at gmail.com>:
>
>> I have this same issue, with Flask 0.10.1, Werkzeug 0.11.3 and mod_wsgi.
>> I haven't found any solution yet. But I'm guessing this means it's a
>> generic problem (not related to version)?
>>
>>
>> The main problem is that the server directs it to that .fcgi or .wsgi
>> file internally, but we don't want it to show that to the user. Django
>> allows you to manually set the URL prefix; maybe there's a way to do this
>> in Flask as well?
>>
>> —Badri/Hippo
>>
>>
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20161013/fc87917c/attachment-0001.html>


More information about the Flask mailing list