108 lines
3.4 KiB
ApacheConf
108 lines
3.4 KiB
ApacheConf
<VirtualHost *:80>
|
|
|
|
ServerName example.com
|
|
ServerAlias *.example.com
|
|
|
|
ErrorLog /dev/null
|
|
CustomLog /dev/null combined
|
|
|
|
# Uncomment to enable http -> https rewrite.
|
|
#
|
|
# RewriteEngine On
|
|
# RewriteCond %{SERVER_NAME} =example.com
|
|
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
|
# Redirect / https://example.com%{REQUEST_URI}
|
|
#
|
|
# If you decide to redirect to https,
|
|
# you're free to comment lines below.
|
|
|
|
# Feeling extra fancy? How about custom 503 page,
|
|
# when the server is down for maintenance?
|
|
# A sample page has been provided in the static/ directory.
|
|
<Directory "/var/www/html/kittyurl-static/">
|
|
Options -Indexes
|
|
AllowOverride All
|
|
</Directory>
|
|
Alias "/.well-known" "/var/www/html/kittyurl-static/.well-known"
|
|
|
|
ProxyPreserveHost On
|
|
ProxyPass /.well-known !
|
|
ProxyPass /.well-known/errors/ !
|
|
ErrorDocument 503 /.well-known/errors/503.html
|
|
|
|
# 1. Match EXACT root "/" (for frontend)
|
|
ProxyPassMatch ^/$ http://127.0.0.1:6568/
|
|
ProxyPassReverse / http://127.0.0.1:6568/
|
|
|
|
# 2. Match "/assets/" and subpaths (for frontend)
|
|
ProxyPass /assets/ http://127.0.0.1:6568/assets/
|
|
ProxyPassReverse /assets/ http://127.0.0.1:6568/assets/
|
|
ProxyPass /panel/ http://127.0.0.1:6568/panel/
|
|
ProxyPassReverse /panel/ http://127.0.0.1:6568/panel/
|
|
ProxyPass /about/ http://127.0.0.1:6568/about/
|
|
ProxyPassReverse /about/ http://127.0.0.1:6568/about/
|
|
|
|
# 3. Match ALL OTHER paths (order matters: least specific LAST)
|
|
# Forward any and all traffic to backend.
|
|
ProxyPass / http://127.0.0.1:6567/
|
|
ProxyPassReverse / http://127.0.0.1:6567/
|
|
|
|
# Shared headers for ALL proxied requests
|
|
<Proxy *>
|
|
RequestHeader set X-Forwarded-Proto "http"
|
|
RequestHeader set X-Real-IP %{X-Forwarded-For}i
|
|
</Proxy>
|
|
|
|
</VirtualHost>
|
|
|
|
<IfModule mod_ssl.c>
|
|
<VirtualHost *:443>
|
|
Include /etc/letsencrypt/options-ssl-apache.conf
|
|
|
|
ServerName example.com
|
|
ServerAlias *.example.com
|
|
|
|
ErrorLog /dev/null
|
|
CustomLog /dev/null combined
|
|
|
|
# Feeling extra fancy? How about custom 503 page,
|
|
# when the server is down for maintenance?
|
|
# A sample page has been provided in the static/ directory.
|
|
<Directory "/var/www/html/kittyurl-static/">
|
|
Options -Indexes
|
|
AllowOverride All
|
|
</Directory>
|
|
Alias "/.well-known" "/var/www/html/kittyurl-static/.well-known"
|
|
|
|
ProxyPreserveHost On
|
|
ProxyPass /.well-known !
|
|
ProxyPass /.well-known/errors/ !
|
|
ErrorDocument 503 /.well-known/errors/503.html
|
|
|
|
# 1. Match EXACT root "/" (for frontend)
|
|
ProxyPassMatch ^/$ http://127.0.0.1:6568/
|
|
ProxyPassReverse / http://127.0.0.1:6568/
|
|
|
|
# 2. Match "/assets/" and subpaths (for frontend)
|
|
ProxyPass /assets/ http://127.0.0.1:6568/assets/
|
|
ProxyPassReverse /assets/ http://127.0.0.1:6568/assets/
|
|
ProxyPass /panel/ http://127.0.0.1:6568/panel/
|
|
ProxyPassReverse /panel/ http://127.0.0.1:6568/panel/
|
|
ProxyPass /about/ http://127.0.0.1:6568/about/
|
|
ProxyPassReverse /about/ http://127.0.0.1:6568/about/
|
|
|
|
# 3. Match ALL OTHER paths (order matters: least specific LAST)
|
|
# Forward any and all traffic to backend.
|
|
ProxyPass / http://127.0.0.1:6567/
|
|
ProxyPassReverse / http://127.0.0.1:6567/
|
|
|
|
# Shared headers for ALL proxied requests
|
|
<Proxy *>
|
|
RequestHeader set X-Forwarded-Proto "https"
|
|
RequestHeader set X-Real-IP %{X-Forwarded-For}i
|
|
</Proxy>
|
|
|
|
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
|
|
</VirtualHost>
|
|
</IfModule> |