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. OmekaS
  3. Omeka S on Cloudron as host for embedded exhibits - CORS

Omeka S on Cloudron as host for embedded exhibits - CORS

Scheduled Pinned Locked Moved OmekaS
7 Posts 4 Posters 1.2k 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.
  • G Offline
    G Offline
    GeHo
    wrote on last edited by
    #1

    We are using Omeka S on Cloudron as an host for several online exhibitions.

    Because something like https://omeka.<cloudron>.<tld>/s/<my-exhibit> is not a very nice and memorable URL, we would like to embed these exhibits in our primary website to get URLs like https://www.<museum>.<tld>/virtual-exhibits/<my-exhibit>.

    We configured our nginx to handle these URLs and to get the content from Omeka, but we ran into a Cross-Origin Resource Sharing (CORS) issue. Searching the forum i found several entries regarding to CORS (e.g. Bug: CORS error), but there doesn't seem to be a consistent solution. In https://forum.cloudron.io/post/64706 @girish gives a quick workaround, but this is not consistent.

    As this issue wasn't addressed in the specific forum and time goes by, i wonder if someone knows a solution for the scenario above. I'm pretty sure I am not the only one with this requirement.

    girishG 1 Reply Last reply
    3
    • G GeHo

      We are using Omeka S on Cloudron as an host for several online exhibitions.

      Because something like https://omeka.<cloudron>.<tld>/s/<my-exhibit> is not a very nice and memorable URL, we would like to embed these exhibits in our primary website to get URLs like https://www.<museum>.<tld>/virtual-exhibits/<my-exhibit>.

      We configured our nginx to handle these URLs and to get the content from Omeka, but we ran into a Cross-Origin Resource Sharing (CORS) issue. Searching the forum i found several entries regarding to CORS (e.g. Bug: CORS error), but there doesn't seem to be a consistent solution. In https://forum.cloudron.io/post/64706 @girish gives a quick workaround, but this is not consistent.

      As this issue wasn't addressed in the specific forum and time goes by, i wonder if someone knows a solution for the scenario above. I'm pretty sure I am not the only one with this requirement.

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

      @GeHo If I understood your setup correctly, you configured nginx to translate www.<museum>.<tld> calls to your omeka.<cloudron>.<tld> ? If this is the case, then there shouldn't be any CORS issue. CORS issue is hit when the browser makes requests directly to omeka when you visit your main site and thus bypassing your nginx. Why do you think this is a CORS issue?

      G 1 Reply Last reply
      1
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #3

        Also how is the embedding happening on the main site? Are you adding an iframe or is there some other way with omeka-s to integrate?

        1 Reply Last reply
        1
        • jeauJ Offline
          jeauJ Offline
          jeau
          App Dev
          wrote on last edited by
          #4

          @GeHo I understand that your main site is not an Omeka installation and that you attempt to integrate each exhibit with an iframe as @nebulon suggests. Is this the case? The CORS issue could come from this approach.

          I can suggest a solution for URLs. You can rename your Omeka site from https://omeka.<cloudron>.<tld> to https://virtual-exhibits.<museum>.<tld> or you can configure a web redirection from https://omeka.<cloudron>.<tld> to https://virtual-exhibits.<museum>.<tld>. Then configure the rewriting of the right-hand part of the URL by using Omeka-S-module-CleanUrl or by inserting rewriting rules in the .htaccess file at the root of your Omeka installation. You can modify the .htaccess file.

          To integrate an Omeka exhibit into a site. I've tested it and it seems to work.

          • one of my Omeka exhibits: https://horae-pictavenses.fr/s/hp/page/accueil
          • within an iframe: https://tools.mexina.fr/iframe/
          • an experimental exhibit that uses external IIIF references: https://graffitheque.eu/s/site/page/welcome
          • within an iframe: https://tools.mexina.fr/iframe/graf.html
          G 1 Reply Last reply
          1
          • jeauJ jeau

            @GeHo I understand that your main site is not an Omeka installation and that you attempt to integrate each exhibit with an iframe as @nebulon suggests. Is this the case? The CORS issue could come from this approach.

            I can suggest a solution for URLs. You can rename your Omeka site from https://omeka.<cloudron>.<tld> to https://virtual-exhibits.<museum>.<tld> or you can configure a web redirection from https://omeka.<cloudron>.<tld> to https://virtual-exhibits.<museum>.<tld>. Then configure the rewriting of the right-hand part of the URL by using Omeka-S-module-CleanUrl or by inserting rewriting rules in the .htaccess file at the root of your Omeka installation. You can modify the .htaccess file.

            To integrate an Omeka exhibit into a site. I've tested it and it seems to work.

            • one of my Omeka exhibits: https://horae-pictavenses.fr/s/hp/page/accueil
            • within an iframe: https://tools.mexina.fr/iframe/
            • an experimental exhibit that uses external IIIF references: https://graffitheque.eu/s/site/page/welcome
            • within an iframe: https://tools.mexina.fr/iframe/graf.html
            G Offline
            G Offline
            GeHo
            wrote on last edited by
            #5

            @jeau Thanks for the suggestions, and sorry for replying this late. However: Happy New Year!

            I don't think that using iFrames to embed an omeka exhibition is very convenient for the user, because he loses the ability to refer to or set a bookmark for a specific page.

            1 Reply Last reply
            0
            • girishG girish

              @GeHo If I understood your setup correctly, you configured nginx to translate www.<museum>.<tld> calls to your omeka.<cloudron>.<tld> ? If this is the case, then there shouldn't be any CORS issue. CORS issue is hit when the browser makes requests directly to omeka when you visit your main site and thus bypassing your nginx. Why do you think this is a CORS issue?

              G Offline
              G Offline
              GeHo
              wrote on last edited by
              #6

              @girish

              Why do you think this is a CORS issue?

              Because the HTML itself delievered by Omeka loads scripts, images, css etc. from the domain of origin. This causes the CORS issues.

              girishG 1 Reply Last reply
              0
              • G GeHo

                @girish

                Why do you think this is a CORS issue?

                Because the HTML itself delievered by Omeka loads scripts, images, css etc. from the domain of origin. This causes the CORS issues.

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

                @GeHo said in Omeka S on Cloudron as host for embedded exhibits - CORS:

                Because the HTML itself delievered by Omeka loads scripts, images, css etc. from the domain of origin. This causes the CORS issues.

                aren't all these covered by same origin policy exceptions ? https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#cross-origin_network_access

                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