Closed creynold closed 8 years ago
I suppose we can safely assume serving Jingo from non-root URL fragment is just not supported. One way for Jingo to be aware of such setups and be able to render different URLS could be an environment variable. This would be in accordance with http://12factor.net.
Also I remember fiddling around with some baseUrl
variable once, too.
On the other side, seperating different applications by subdomains is not only helpful regarding CSRF or XSS attacks. I propose not to support this scenario.
It'd probably enough to make Jingo aware of being served ("mounted") in a subdirectory, the way WordPress does with WP_SITEURL configuration variable. As @almereyda mentioned, I am not really sure about all the consequences (WP introduced that option only from version 2.2), so I am not thinking to implement it right now. It should be easy to hack something in your local setup though.
I propose to close this issue. nginx supports rewrite rules for proxy_pass
. See https://raymii.org/s/tutorials/NGINX_proxy_folder_to_different_root.html for details.
Nevertheless the info gained should live in some kind of #117
I re-tried using rewrite rules:
location /wiki/ {
rewrite ^/wiki(/.*)$ $1 break;
proxy_pass http://127.0.0.1:6067/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
The wiki pages are served correctly as far as I can tell, but the resources still fail to load (*.css
, *.js
, etc.). I guess this makes sense... I don't think there's a way to do this from NGINX.
I have another idea: could you add a config variable to specify the location of static files? A lot of other frameworks do this (e.g. Django).
Closed in favour of #124
I'm using NGINX with jingo. First I defined a server block:
Now if I browse to
http://<server domain>:8080
everything works fine. I'd like to move this tohttp://<server domain>/wiki
, however. But when I do this:All of the urls in the jingo page are relative to the server root, and so no css/js files are loaded. Additionally it defaults to
http://<server domain>/wiki/Home
instead ofhttp://<server domain>/wiki/wiki/Home
.Is there a way around this?
Thanks