logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Use Apache to access my other server
Author
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Sat 02 May '20 14:42    Post subject: Use Apache to access my other server Reply with quote

Hello,

I have a nas server, and I would have liked to be able to access its web interface on an address like https://nas.mydomain.fr

I'm using a let's encrypt certificate for mydomain.fr.
But I don't know how to redirect requests from the "nas" sub-domain and above all, how to apply the certificate to it.

Knowing that the nas is a synology.
Could you help me set this up?
Thank you
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 02 May '20 17:20    Post subject: Reply with quote

The key word is reverse proxy

Code:

<VirtualHost *:443>
        ServerName nas.mydomain.fr
        DocumentRoot /c/www

       <Directory /c/www>
                Options Indexes FollowSymLinks
                AllowOverride None
                Require all granted
        </Directory>

       ProxyPass / http://192.168.0.10/
       ProxyPassReverse / http://192.168.0.10/

        SSLEngine on
        SSLCertificateFile  /c/etc/letsencrypt/live/nas.mydomain.fr/fullchain.pem
        SSLCertificateKeyFile /c/etc/letsencrypt/live/nas.mydomain.fr/privkey.pem
</VirtualHost>


Note that /c/www (C:\www\) can be empty, but it must exist.
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Sat 02 May '20 18:50    Post subject: Reply with quote

Oh !
Maybe that's my mistake !
I never set a documentroot when i try to set reverseproxy.

I'll take a look as soon as possible !
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Sat 02 May '20 19:50    Post subject: Reply with quote

Ok, i have an error, but i don't know where...

Here is my config :
Code:
<VirtualHost *:443>
   ServerName nas.mydomain.biz
   DocumentRoot e:/www/mydomain/html/nas/

   <Directory e:/www/mydomain/html/nas/>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
   </Directory>

   ProxyPass / http://172.16.0.250:5180/
   ProxyPassReverse / http://172.16.0.250:5180/

   SSLEngine on
   SSLCertificateFile C:/Certificats/POSH-acme/fullchain.cer
   SSLCertificateKeyFile C:/Certificats/POSH-acme/cert.key
   SSLCertificateChainFile C:/Certificats/POSH-acme/chain.cer
</VirtualHost>


And it lead me to an error 500.
Is there anything else that "LoadModule proxy_module modules/mod_proxy.so" needed ?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 02 May '20 23:40    Post subject: Reply with quote

Yes you need also mod_proxy_http

see also https://httpd.apache.org/docs/current/mod/mod_proxy.html
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Sat 02 May '20 23:45    Post subject: Reply with quote

Argh ! That's it.

Thanks a lot, it work fine now.
Back to top


Reply to topic   Topic: Use Apache to access my other server View previous topic :: View next topic
Post new topic   Forum Index -> Apache