<div dir="ltr">if I manually add /flaskbb in layout.html, the link seems good (eg <link rel="stylesheet" href="/flaskbb/static/css/styles.css"> but flaskbb app return a 404 to nginx on request :<br><br>127.0.0.1 - - [10/Jun/2016 14:18:54] "GET /flaskbb/ HTTP/1.0" 200 -<br>127.0.0.1 - - [10/Jun/2016 14:18:54] "GET /flaskbb/static/css/pygments.css HTTP/1.0" 404 -<br>127.0.0.1 - - [10/Jun/2016 14:18:54] "GET /flaskbb/static/css/styles.css HTTP/1.0" 404 -<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-10 14:16 GMT+02:00 Pascal <span dir="ltr"><<a href="mailto:patatetom@gmail.com" target="_blank">patatetom@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><span lang="en"><span>thank you</span> <span>for track </span></span>Ulrich<br><br></div>I've changed the url prefixes defined in <a href="https://github.com/sh4nks/flaskbb/blob/master/flaskbb/configs/default.py#L117-121" target="_blank">default.py</a> and used in <a href="https://github.com/sh4nks/flaskbb/blob/master/flaskbb/app.py#L80-89" target="_blank">app.py</a> with register_blueprint.<br></div>I've also changed nginx directive to <code>location /flaskbb/ { proxy_pass <a href="http://127.0.0.1:8765/flaskbb/" target="_blank">http://127.0.0.1:8765/flaskbb/</a>; }</code>.<br></div><br>now links are good :-) except static files like css :-(.<br><br>for example, this link <link rel="stylesheet" href="/static/css/styles.css"> is made with template <a href="https://github.com/sh4nks/flaskbb/blob/master/flaskbb/templates/layout.html#L26" target="_blank">layout.html</a> by url_for...<div><div class="h5"><br><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">2016-06-10 12:43 GMT+02:00 Ulrich Berthold <span dir="ltr"><<a href="mailto:ub@artfacts.net" target="_blank">ub@artfacts.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hey pascal,<br>
<br>
when using blueprints, you can pass the url prefix as an argument to<br>
register_blueprint, like this:<br>
<br>
app.register_blueprint(api, url_prefix='/api')<br>
<br>
will make api aceesable under <a href="https://my.url/api" rel="noreferrer" target="_blank">https://my.url/api</a> and urls created with<br>
url_for in that context will have the prefix.<br>
<br>
there is a  stackoverflow question, which i think handles your problem:<br>
<a href="http://stackoverflow.com/questions/18967441/add-a-prefix-to-all-flask-routes" rel="noreferrer" target="_blank">http://stackoverflow.com/questions/18967441/add-a-prefix-to-all-flask-routes</a><br>
<br>
cheers,<br>
ub<br>
<br>
<br>
On Fri, Jun 10, 2016 at 11:52:57AM +0200, Pascal wrote:<br>
> hello,<br>
><br>
> my flask app (flaskbb <<a href="https://github.com/sh4nks/flaskbb" rel="noreferrer" target="_blank">https://github.com/sh4nks/flaskbb</a>>) is listening on<br>
<span>> <a href="http://127.0.0.1:8765" rel="noreferrer" target="_blank">127.0.0.1:8765</a> and is ok when accessed directly with <a href="http://127.0.0.1:8765/" rel="noreferrer" target="_blank">http://127.0.0.1:8765/</a>.<br>
><br>
> when accessed through nginx with <a href="http://mywebserver/flaskbb/" rel="noreferrer" target="_blank">http://mywebserver/flaskbb/</a>, all links are<br>
> broken because /flaskbb is missing in the url (eg. src="/css/..." and not<br>
> src="/flaskbb/css/...").<br>
><br>
> I currently bypasses the problem by modifying the templates, but it's not<br>
> clean :-(<br>
><br>
> how can I solve this problem ?<br>
><br>
> note that nginx directive is location /flaskbb/ { proxy_pass<br>
> <a href="http://127.0.0.1:8765/" rel="noreferrer" target="_blank">http://127.0.0.1:8765/</a>; } and I can't play with virtual-server/dns.<br>
<br>
</span>> _______________________________________________<br>
> Flask mailing list<br>
> <a href="mailto:Flask@python.org" target="_blank">Flask@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
<br>
</blockquote></div><br></div></div></div></div></div></div></div>
</blockquote></div><br></div>