Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

apache2 - Letting Apache handle HTTPS for an application

I am not 100% sure I am doing the correct thing or using the correct phrases, so I just have to ask:

I have an application that requires being spoken to via HTTPS to confirm a webhook subscription that I want to put behind a subdomain, yet I am not interested in dealing with certificates, so I want to listen to, for example, local port 3333 while the apache deals with all the certification and listens to port 443, redirecting all traffic that comes over subdomain.mydomain.tld to my local port 3333 as already unencrypted http requests.

I create my certificates with letsencrypt and certbot.

My 000-default-le-ssl.conf contains:

<VirtualHost *:443>
    ServerName subdomain.mydomain.tld

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:3333/
    ProxyPassReverse / http://127.0.0.1:3333/

    SSLCertificateFile /etc/letsencrypt/live/mydomain.tld/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.tld/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

And my 000-default.conf:

<VirtualHost *:80>
    ServerName subdomain.mydomain.tld

    Redirect / https://subdomain.mydomain.tld/
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =subdomain.mydomain.tld
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

I can access the app from my browser via accessing https://subdomain.mydomain.tld yet the webhook service I want to subscribe to doesn't seem to be making contact. Is there something wrong with my config? I need to know that before I start debugging other stuff.

question from:https://stackoverflow.com/questions/65918856/letting-apache-handle-https-for-an-application

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...