Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

PATH issue with mod_proxy / mod_rewrite #2

Open
neoice opened this issue Jan 15, 2010 · 5 comments
Open

PATH issue with mod_proxy / mod_rewrite #2

neoice opened this issue Jan 15, 2010 · 5 comments

Comments

@neoice
Copy link

neoice commented Jan 15, 2010

so as written, theory assumes that it will always operate as its own port with its own root (/). however, if you try and include it as part of another hierarchy, you get PATH-related breakage. for example, I run theory on an internal server and want to access it from an external web server using apache2's mod_rewrite like so:

RewriteRule ^/mpd/(.*) http://192.168.10.1:9099/$1 [P]

now when theory renders, it looks for /js, which may not actually exist. I think this can mostly be fixed by removing the preceding slash from all the paths, replacing it with ./ or defining an internal PATH variable so we can define the root at will. I'd be happy to knock out a patch for you. do you a have a preference on how to do this? or do you even want this? I can just fork and maintain a separate patch for my bizarre edge-case setup :D

@ralfonso
Copy link
Owner

I've wanted to do this for a while, but the core javascript methods use hard-coded paths. It shouldn't be too much of a problem, but I just haven't taken the time to look at it.

@neoice
Copy link
Author

neoice commented Jan 16, 2010

"core" as in stuff you wrote or JQuery? I took a poke at it last night and it did look like a path change would be required in almost every file.

@ralfonso
Copy link
Owner

Stuff I wrote. I didn't worry too much about hard-coding everything when I wrote it because it started out being for personal-use only and I was happy to have a standalone server. I still want to do it, but figuring out a good way to rewrite all of the paths in js/theory.js will be a challenge.

@neoice
Copy link
Author

neoice commented Feb 14, 2010

is this still something you're interested in? between work, college and college application season, I've kinda stopped coding anything :/

@neoice
Copy link
Author

neoice commented Apr 15, 2011

I finally got off my ass and worked on this. I'll send a pull request. it touches a ton of lines, but they're all pretty trivial, mostly turning "/" into "./" and the occasional "../"

it's been tested by using both the proxy and non-proxy interfaces at the same time and looking for 404/500 errors with Firebug. as far as I can tell, it "works", minus a few places in jquery-ui.

currently, the URL prefix is hardcoded into the dev and server INIs. I'm not sure how to change that if it's required.

next project is to create a skeleton for running the server through mod_wsgi.

edit: hit the wrong button, but it can probably be closed.

@neoice neoice closed this as completed Apr 15, 2011
@neoice neoice reopened this Apr 15, 2011
jkliff pushed a commit to jkliff/theory that referenced this issue May 5, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants