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

    Sempolice redirect haproxy o squidreverse proxy

    Scheduled Pinned Locked Moved Italiano
    22 Posts 3 Posters 2.4k Views
    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.
    • frankzF
      frankz
      last edited by

      Ciao a tutti , ho 3 server in lan con certificato let'encrypt . Dispongo solo si un ip esterno . Vorrei sapere se è possibile effettuare un redirect 443 e 80 sul nome fqdn esterno e di conseguenza smistarlo al server di competenza . Grazie .

      kiokomanK 1 Reply Last reply Reply Quote 0
      • kiokomanK
        kiokoman LAYER 8 @frankz
        last edited by

        @frankz
        si con il pachetto haproxy per smistare e acme per i certificati

        in ha proxy configuri il frontend per intercettare gli fqdn
        in backend configuri i server di destinazione
        poi dici al frontend a quale server di backend deve essere inoltrata la chiamata

        con acme generi i certificati letsencrypt direttamente su pfsense per farli usare a haproxy

        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
        Please do not use chat/PM to ask for help
        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

        frankzF 2 Replies Last reply Reply Quote 0
        • frankzF
          frankz @kiokoman
          last edited by

          @kiokoman ciao e grazie . Ma se i certificati sono già presenti sui server , si può fare ciò che hai scritto ?

          kiokomanK 1 Reply Last reply Reply Quote 0
          • kiokomanK
            kiokoman LAYER 8 @frankz
            last edited by

            @frankz
            credo di si, personalmente trovo più comodo gestire i certificati in un punto solo e lasciare i server in backend sulla porta 80 non ho mai provato in altri modi, in pratica lascio che sia haproxy a gestire la comunicazione ssl con i client (https), mentre la comunicazione coi server in backend avviene in http

            ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
            Please do not use chat/PM to ask for help
            we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
            Don't forget to Upvote with the 👍 button for any post you find to be helpful.

            frankzF 1 Reply Last reply Reply Quote 1
            • frankzF
              frankz @kiokoman
              last edited by

              @kiokoman grazie per il tuo intervento , proverò a fare dei test .

              1 Reply Last reply Reply Quote 0
              • frankzF
                frankz @kiokoman
                last edited by

                @kiokoman Ciao , ieri ho iniziato a provare la configurazione , ma mi trovo in difficoltà . Dove posso trovare un esempio semplice per quello che ho richiesto ? Grazie .

                kiokomanK 1 Reply Last reply Reply Quote 0
                • kiokomanK
                  kiokoman LAYER 8 @frankz
                  last edited by

                  @frankz
                  questo ad esempio
                  https://gainanov.pro/eng-blog/linux/installing-haproxy-pfsense/
                  ad occhio sta facendo la tua stessa cosa

                  ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                  Please do not use chat/PM to ask for help
                  we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                  Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                  frankzF 1 Reply Last reply Reply Quote 1
                  • frankzF
                    frankz @kiokoman
                    last edited by

                    @kiokoman Grazie soprattutto per la tua gentilezza . Proverò a seguire quanto indicato nel blog

                    1 Reply Last reply Reply Quote 0
                    • C
                      ciclopeblu
                      last edited by

                      Ciao, io uso haproxy con la configurazione che cerchi. se non riesci, fammi sapere che potrei probabilmente aiutarti.

                      frankzF 1 Reply Last reply Reply Quote 1
                      • frankzF
                        frankz @ciclopeblu
                        last edited by

                        @ciclopeblu ciao , allora occultando i nomi dei tuoi server riesci a mandarmi degli screen shot ? Se possibile chiaramente ! Grazie in anticipo

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          ciclopeblu @frankz
                          last edited by

                          @frankz

                          Se parly un po' di inglese, questa e' una guida perfetta:

                          https://www.youtube.com/watch?v=bU85dgHSb2E

                          In pratica io ho una configuazione come questa:

                          1 dominio: test.com

                          3 sottodomini:

                          • server1.test.com
                            server2.test.com
                            server3.test.com

                          quando un utente si collega in uno dei sottodomini, ad esempio https://server1.test.com (porta 443 quindi) il traffico e' inoltrato al server1:86 (porta 86 per intenderci)

                          frankzF 1 Reply Last reply Reply Quote 0
                          • frankzF
                            frankz @ciclopeblu
                            last edited by

                            @ciclopeblu Non è quello che fa per me . I certificati li ho già sui server , ha proxy e pfsense non devono gestire loro i certificati .

                            C 1 Reply Last reply Reply Quote 0
                            • C
                              ciclopeblu @frankz
                              last edited by

                              @frankz Ma se i certificati sul singolo server sono corretti per il dominio non vedo perche' non dovrebbe funzionare. Ci sono opzioni per l' "offlloading" dei certificati, hai provato?

                              frankzF 2 Replies Last reply Reply Quote 1
                              • frankzF
                                frankz @ciclopeblu
                                last edited by

                                @ciclopeblu Ho visto che nel video fa riferimento a haproxy let'encrypt . Quello che ho chiesto e richiedo è semplice ovvero che haproxy deve solo smistare https e 80 suoi server in base all'url sorgente che in parole povere è semplice es. se da internet digito https://www.1primoserver.ddns.net la chiamat andrà al primo server e cosi a seguire senza variare alcuna porta tcp interna che rimangono per i seerver 80 e 443 . In sintesi una specie di dnat 1:1 entra https e arrviva https in base all'url .

                                1 Reply Last reply Reply Quote 0
                                • frankzF
                                  frankz @ciclopeblu
                                  last edited by

                                  @ciclopeblu Ciao , volevo solo farti una domanda :
                                  A prescindere che i certificati siano sui server , diamo per scontato che pfsense deve avere almeno un certificato sel valido ? oppure quello autogenerato va bene ?

                                  1 Reply Last reply Reply Quote 0
                                  • frankzF
                                    frankz
                                    last edited by

                                    Continuo a provare ma niente da fare . Pare che il problema sia legato al DNS . Lo schema iìn allegato , mostra i server in LAN con il proprio nome fqdn .
                                    Pfsense si occupa di registrare dai dns dinamici questi nomi , e tramite l'opzione di dns override , li ho inserirti per poterli raggiungere dalla LAN . Quindi se esempio provo a digitare https://myserver.fqdn , anche se effettivamente il suo hostname in wan è valido , tramite LAN e override dell'host lo raggiungo in LAN . Il problema si verifica che dalla wan il nome fqdn si ferma al pfsense , perchè è sempre lui stesso (1 ip 4 hostname dinamici ) . Qualcuno mi ha detto che occorre separare la gestione dei dns per haproxy , ma non so come fare !
                                    haproxy.jpg

                                    kiokomanK 1 Reply Last reply Reply Quote 0
                                    • kiokomanK
                                      kiokoman LAYER 8 @frankz
                                      last edited by kiokoman

                                      @frankz
                                      hai provato a impostare i dns su settings di haproxy?
                                      Global DNS resolvers for haproxy
                                      se hai registrato i domini su "dns resolver" e dici ad haproxy di usare solo quello dovrebbe perlomeno risolvere quelle macchine

                                      ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                                      Please do not use chat/PM to ask for help
                                      we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                                      Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                                      frankzF 1 Reply Last reply Reply Quote 0
                                      • frankzF
                                        frankz @kiokoman
                                        last edited by

                                        @kiokoman ciao se lo schema è chiaro, come imposto i dns a cui fai riferimento? Potresti farmi un esempio? Grazie

                                        kiokomanK 1 Reply Last reply Reply Quote 0
                                        • kiokomanK
                                          kiokoman LAYER 8 @frankz
                                          last edited by

                                          @frankz
                                          no, non capisco il problema e non mi è chiaro cosa intendi per host dinamici.

                                          haproxy ha due sezioni, una frontend e una backend

                                          il frontend, che è quella che si presenta e comunica coi client intercetta il nome host e reindirizza la comunicazione al server interno che hai indicato nel backend

                                          nel backend crei il server mettendo l'ip interno della lan, se vuoi usare il home host interno della lan sul backend devi assicurarti che dns resolver lo riconosca e dire a haproxy di usare 127.0.0.1 come unico dns server

                                          un altro errore comune è quella di fare un port forward sul firewall invece che aprire semplicemente la porta con destinazione "this firewall"

                                          ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                                          Please do not use chat/PM to ask for help
                                          we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                                          Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                                          frankzF 2 Replies Last reply Reply Quote 0
                                          • frankzF
                                            frankz @kiokoman
                                            last edited by

                                            @kiokoman Innanzitutto grazie per aver risposto . Quindi per il dns metto 127.0.0.1 nelle global entry del dns ( e porta 53 ) ?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.