Engineering and technology notes

proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow

he setup:

Server A) Apache server that only serves proxypass and doesn’t host anything

Server B) Apache server that hosts main domain.com

Server C) Apache server that hosts ZoneMinder @ domain.com/zm

Server A Config:

<VirtualHost *:80>
ServerName domain.com
Redirect / https://www.domain.com/
</VirtualHost>

<VirtualHost *:443>
ServerName www.domain.com
ProxyRequests Off
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
SSLEngine on
SSLCertificateFile /location of .crt
SSLCertificateKeyFile /location of .key
SSLCACertificateFile /location of .crt
ProxyPreserveHost on

ProxyPass /zm https://192.168.1.43:443/zm
ProxyPassReverse /zm https://192.168.1.43:443/zm


ProxyPass / https://192.168.1.42:443/
ProxyPassReverse / https://192.168.1.42:443/

<Location />
    Order allow,deny
    Allow from all
</Location>
</VirtualHost>

Notes: It is important to have the /zm come before the “/” catch all. I also noticed it FAILED if i used /zm/.

 

Source: proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow

proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow was last modified: July 21st, 2021 by Jovan Stosic

proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow

Viewed 3k times

0

1

I have 3 Apache VM’s running currently:

A) ProxyPass (Hosts Nothing)
B) Main Website
C) ZoneMinder Website

If you access example.com you get to the website, and can navigate around, but…

If I manually type http://example.com/zm trying to access zoneminder

It redirects http://example.com/zm in my remote browser to http://192.168.1.255:443/foo*

I can’t seem to get my redirect working correctly, can anybody see what I am doing wrong?

Configs:

A) ProxyPass Server:

<VirtualHost *:80>
    ServerName          www.example.com
    RedirectPermanent / http://example.com
</VirtualHost>

<VirtualHost *:80>
ServerName example.com
ProxyRequests Off
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass / http://192.168.1.255:80/
ProxyPassReverse / http://192.168.1.255:80/
<Location />
    Order allow,deny
    Allow from all
</Location>
</VirtualHost>

B) Main Website

<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/html
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/example.log
CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>

0

Got it working!

The setup:

Server A) Apache server that only serves proxypass and doesn’t host anything

Server B) Apache server that hosts main domain.com

Server C) Apache server that hosts ZoneMinder @ domain.com/zm

Server A Config:

<VirtualHost *:80>
ServerName domain.com
Redirect / https://www.domain.com/
</VirtualHost>

<VirtualHost *:443>
ServerName www.domain.com
ProxyRequests Off
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
SSLEngine on
SSLCertificateFile /location of .crt
SSLCertificateKeyFile /location of .key
SSLCACertificateFile /location of .crt
ProxyPreserveHost on

ProxyPass /zm https://192.168.1.43:443/zm
ProxyPassReverse /zm https://192.168.1.43:443/zm


ProxyPass / https://192.168.1.42:443/
ProxyPassReverse / https://192.168.1.42:443/

<Location />
    Order allow,deny
    Allow from all
</Location>
</VirtualHost>

Notes: It is important to have the /zm come before the “/” catch all. I also noticed it FAILED if i used /zm/.

 

Source: proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow

proxypass – Redirect domain.com/path to another Apache Server – Stack Overflow was last modified: July 21st, 2021 by Jovan Stosic

[solved] “Unable to connect to Home Assistant” from WAN (Duck DNS + NGINX) – Home Assistant OS

http: use_x_forwarded_for:

true trusted_proxies:

172.30.33.0/24

192.168.1.192

ip_ban_enabled:

true login_attempts_threshold: 5

Source: [solved] “Unable to connect to Home Assistant” from WAN (Duck DNS + NGINX) – Home Assistant OS – Home Assistant Community

[solved] “Unable to connect to Home Assistant” from WAN (Duck DNS + NGINX) – Home Assistant OS was last modified: July 17th, 2021 by Jovan Stosic

DNS on Ubuntu 18.04

For years it’s been simple to set up DNS on a Linux machine. Just add a couple of entries to /etc/resolv.conf and you’re done.

# Use Google's public DNS servers.
nameserver 8.8.4.4
nameserver 8.8.8.8

But things change and now it’s not that simple. If you now edit /etc/resolv.conf on Ubuntu you’ll find that the edits are ephemeral. If you restart (or even hibernate) your machine then they’ll be overwritten by default content.

nameserver 127.0.0.53
search Home

This is pretty simple to fix though.

  1. Install the resolvconf package.
sudo apt install resolvconf
  1. Edit /etc/resolvconf/resolv.conf.d/head and add the following:
# Make edits to /etc/resolvconf/resolv.conf.d/head.
nameserver 8.8.4.4
nameserver 8.8.8.8
  1. Restart the resolvconf service.
sudo service resolvconf restart

Fix should be permanent.

 

Source: DNS on Ubuntu 18.04 – datawookie

DNS on Ubuntu 18.04 was last modified: July 16th, 2021 by Jovan Stosic

Via Panisperna boys

The Via Panisperna boys (Italian: I ragazzi di Via Panisperna) were a group of young scientists led by Enrico Fermi. In Rome in 1934, they made the famous discovery of slow neutrons which later made possible the nuclear reactor, and then the construction of the first atomic bomb.

The nickname of the group comes from the address of the Physics Institute, at the University of Rome La Sapienza. The Via Panisperna, a street of Rione Monti in the city center, got its name from a nearby monastery, San Lorenzo in Panisperna.

The other members of the group were Edoardo AmaldiOscar D’AgostinoEttore MajoranaBruno PontecorvoFranco Rasetti and Emilio Segrè. All of them were physicists, except for D’Agostino who was a chemist.

Source: Via Panisperna boys – Wikipedia

Via Panisperna boys was last modified: July 10th, 2021 by Jovan Stosic