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
317 views
in Technique[技术] by (71.8m points)

node.js - how do I properly configure my apache(linux centos7) virtual host for reverse proxy to properly work with my node app(https)

I have tried for several days to configure apache virtual host for reverse proxy with node app on a linux centos7 production server but I keep seeing the default apache testing page instead of the node default home page. When I run the app on my machine(localhost:45000) it works but if run the domainname.com I get the apache testing 123 page.Below is my virtual host config. <VirtualHost *:80> DocumentRoot /var/www/html/ ServerName lawspectre.net ServerAlias www.lawspectre.net ErrorLog /var/log/httpd/lawspectre.net-error_log CustomLog /var/log/httpd/lawspectre.net-access_log combined

<Directory /var/www/html/>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =lawspectre.net [OR]
RewriteCond %{SERVER_NAME} =www.lawspectre.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName lawspectre.net
ServerAlias www.lawspectre.net
ErrorLog /var/log/httpd/lawspectre.net-error_log
CustomLog /var/log/httpd/lawspectre.net-access_log combined

SSLEngine on
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCertificateFile /etc/letsencrypt/live/lawspectre.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/lawspectre.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/lawspectre.net/chain.pem

#Reverse proxy configuration
ProxyRequests off
ProxyPass /  http://localhost:45000
ProxyPassReverse /  http://localhost:45000
</VirtualHost>

I need help in getting this working properly

question from:https://stackoverflow.com/questions/65841096/how-do-i-properly-configure-my-apachelinux-centos7-virtual-host-for-reverse-pr

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
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

...