Giter VIP home page Giter VIP logo

Comments (2)

seocam avatar seocam commented on July 30, 2024

@Timokasse we, as all reverse proxies I know don't actually change the the path of other secondary requests. In fact each request is a new request. So, if you request in your browser the page http://myproxy/app1/toto.html your page can refer the css in many different ways. Usually ways are:

  • css/default.css: in this case your page would probably serve the css correctly because the path is relative. In the other hand it's usually somehow confusing to handle relative links from your page.
  • /css/default.css: in this case it will not work because the path is hard coded (starting with a slash). In this case you would get the result you commented above.
  • http://myproxy/css/default.css: here is the same case than above but a bit worse because hard coding the hostname is not such a good idea (if you change the domain you would have to look for it and replace in all the code).
    /css/default.css
  • /<PREFIX>/css/default.css: and last but not least, you can prefix your imports with a configurable variable. That's how usually big apps handle proxing nicely. If you are using a web framework they usually provide you a way of doing this prefix. If you are not you could take a look at saas or less for instance.

So, basically you app has to be minimally prepared to work with proxies.

from django-revproxy.

seocam avatar seocam commented on July 30, 2024

@Timokasse if you have any doubts please or disagree with my answer please reopen.

Cheers

from django-revproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.