Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. App proxy with internal IP does not replace IP in html code

App proxy with internal IP does not replace IP in html code

Scheduled Pinned Locked Moved Solved Support
app proxy
5 Posts 4 Posters 771 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      M Offline
      matthijs
      wrote on last edited by girish
      #1

      So I have a box directly connected to my cloudron box, 10.0.0.1-10.0.0.2 ip with a simple webserver serving pages and images.

      I install an app proxy app on my cloudron using the app url (http://10.0.0.2/)

      Now when I go to my app.proxydomain.com hosted on cloudron it loads the html nicely, but not the pictures as they are still served with the http://10.0.0.2/img.jpg src in the html instead of also getting proxied to http://app.proxydomain.com/img.jpg.

      Any quick way to fix this?

      1 Reply Last reply
      1
      • KubernetesK Offline
        KubernetesK Offline
        Kubernetes
        App Dev
        wrote on last edited by Kubernetes
        #2

        One way to fix this would be to update the HTML on the webserver to use the proxied URL (http://app.proxydomain.com/img.jpg) for the images, rather than the direct URL (http://10.0.0.2/img.jpg).

        Another option would be to use relative paths for the images in the HTML.

        Another option would be to configure the proxy app to rewrite the URLs of the images to the proxied URL.

        fbartelsF 1 Reply Last reply
        1
        • KubernetesK Kubernetes

          One way to fix this would be to update the HTML on the webserver to use the proxied URL (http://app.proxydomain.com/img.jpg) for the images, rather than the direct URL (http://10.0.0.2/img.jpg).

          Another option would be to use relative paths for the images in the HTML.

          Another option would be to configure the proxy app to rewrite the URLs of the images to the proxied URL.

          fbartelsF Offline
          fbartelsF Offline
          fbartels
          App Dev
          wrote on last edited by
          #3

          @Kubernetes said in App proxy with internal IP does not replace IP in html code:

          Another option would be to use relative paths for the images in the HTML.

          yes, it is in general a good practice to use relative urls in web projects.

          1 Reply Last reply
          2
          • girishG girish marked this topic as a question on
          • girishG girish has marked this topic as solved on
          • M Offline
            M Offline
            matthijs
            wrote on last edited by
            #4

            Thanks for the suggestions guys but the box is actually an appliance which I have no control over. A regex replace function for the data received internally would be ideal and fix all usecases imho.

            girishG 1 Reply Last reply
            0
            • M matthijs

              Thanks for the suggestions guys but the box is actually an appliance which I have no control over. A regex replace function for the data received internally would be ideal and fix all usecases imho.

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by girish
              #5

              @matthijs that's not possible because HTML/Javascript is opaque "data" and one cannot replace things without understanding what the data is.

              For example, the HTML could say "Your IP is NOT xxxxx" or "Your friend is at IP yyyy" or just about anything else. There is no way to reliably replace HTML (other than the app itself).

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Bookmarks
                • Search