Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    HAProxy redirect neue Domain gleiche Struktur

    Deutsch
    2
    3
    216
    Loading More Posts
    • 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.
    • A
      alexander90 last edited by

      Hallo zusammen,

      ich habe eine neue Domain auf einem neuen Server. Ich möchte gerne über HAProxy beim Aufruf der alten Domain eine 301 Weiterleitung an die neue Domain vornehmen.

      Dazu habe ich im Frontend eine acl erstellt die auf Host matches: "alteurl.de" sucht.
      In den Actions habe ich dann eine CustumACL erstellt: http-request redirect code 301 location "neueurl.de"

      Problem nun: Wenn ich auf alteurl.de/test/test gehe macht er immer den redict auf neueurl.de und nicht auf neueurl.de/test/test.

      Wie muss ich es einstellen, dass er auch den Path mitnimmt?!
      Kann mir jemand die richtige Actions acl nennen?

      Danke!

      Viele Grüße
      Alexander

      1 Reply Last reply Reply Quote 0
      • JeGr
        JeGr LAYER 8 Moderator last edited by

        Kannst du mal versuchen bei der 301 location nach der URL noch %[req.uri] anhängen?

        Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

        If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

        1 Reply Last reply Reply Quote 0
        • A
          alexander90 last edited by

          @JeGr said in HAProxy redirect neue Domain gleiche Struktur:

          %[req.uri]

          Dann kommt leider eine Fehlermeldung:

          [ALERT] 205/123827 (79381) : parsing [/var/etc/haproxy_test/haproxy.cfg:81] : error detected in frontend 'NachOpenVPN_HTTPS' while parsing 'http-request redirect' rule : failed to parse sample expression <req.uri> : unknown fetch method 'req.uri'. 
          [ALERT] 205/123827 (79381) : Error(s) found in configuration file : /var/etc/haproxy_test/haproxy.cfg
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post