Update vhost-gen templates

This commit is contained in:
cytopia 2022-12-27 02:58:40 +01:00
parent e18e923d87
commit b05f4240f3
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
4 changed files with 116 additions and 34 deletions

View File

@ -34,10 +34,23 @@
# __ERROR_LOG__
#
###
### Notes about Apache
###
#
# 1. Each same directive is checked in order of definition (last one wins)
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
# * Last match always takes precedence
#
# Exception: Directories, where shortest path is matched first
# Exception: ProxyPass and Alias first match and then stops
###
### Basic vHost skeleton
###
### Note: Reverse Proxy section must be last for Apache 2.2
###
vhost: |
<VirtualHost __DEFAULT_VHOST__:__PORT__>
ServerName __VHOST_NAME__
@ -45,11 +58,17 @@ vhost: |
CustomLog "__ACCESS_LOG__" combined
ErrorLog "__ERROR_LOG__"
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://php:8000/ retry=0
ProxyPassReverse / http://php:8000/
ProxyVia On
<Location />
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
ProxyPass http://php:8000/ retry=0
ProxyPassReverse http://php:8000/
</Location>
__REDIRECT__
__SSL__
@ -102,10 +121,10 @@ features:
deny: |
# Deny Definition
<FilesMatch "__REGEX__">
<LocationMatch "__REGEX__">
Order allow,deny
Deny from all
</FilesMatch>
</LocationMatch>
server_status: |
# Status Page

View File

@ -40,10 +40,23 @@
# __PHP_PORT__
#
###
### Notes about Apache
###
#
# 1. Each same directive is checked in order of definition (last one wins)
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
# * Last match always takes precedence
#
# Exception: Directories, where shortest path is matched first
# Exception: ProxyPass and Alias first match and then stops
###
### Basic vHost skeleton
###
### Note: Reverse Proxy section must be last for Apache 2.2
###
vhost: |
<VirtualHost __DEFAULT_VHOST__:__PORT__>
ServerName __VHOST_NAME__
@ -57,10 +70,10 @@ vhost: |
__PHP_FPM__
__ALIASES__
__DENIES__
__VHOST_RPROXY__
__SERVER_STATUS__
# Custom directives
__CUSTOM__
__VHOST_RPROXY__
</VirtualHost>
###
@ -86,28 +99,36 @@ vhost_type:
# Reverse Proxy (-r http(s)://ADDR:PORT)
rproxy: |
# Define Reverse Proxy
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
ProxyVia On
<Location __LOCATION__>
# Reverse Proxy
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</Location>
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
rproxy_ws: |
# Define Reverse Proxy with Websock support
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
<location __LOCATION__>
ProxyVia On
<Location __LOCATION__>
# Websocket Rewrite Settings
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule ^/?(.*)$ __WS_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/$1 [P,L]
# Reverse Proxy Settings
# Reverse Proxy
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</location>
</Location>
###
@ -147,10 +168,10 @@ features:
deny: |
# Deny Definition
<FilesMatch "__REGEX__">
<LocationMatch "__REGEX__">
Order allow,deny
Deny from all
</FilesMatch>
</LocationMatch>
server_status: |
# Status Page

View File

@ -34,6 +34,17 @@
# __ERROR_LOG__
#
###
### Notes about Apache
###
#
# 1. Each same directive is checked in order of definition (last one wins)
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
# * Last match always takes precedence
#
# Exception: Directories, where shortest path is matched first
# Exception: ProxyPass and Alias first match and then stops
###
### Basic vHost skeleton
@ -46,11 +57,19 @@ vhost: |
CustomLog "__ACCESS_LOG__" combined
ErrorLog "__ERROR_LOG__"
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyAddHeaders: Add "X-Forward-*" headers
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://php:8000/ retry=0
ProxyPassReverse / http://php:8000/
ProxyAddHeaders On
ProxyVia On
<Location />
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
ProxyPass http://php:8000/ retry=0
ProxyPassReverse http://php:8000/
</Location>
__REDIRECT__
__SSL__
@ -104,10 +123,10 @@ features:
deny: |
# Deny Definition
<FilesMatch "__REGEX__">
<LocationMatch "__REGEX__">
Order allow,deny
Deny from all
</FilesMatch>
</LocationMatch>
server_status: |
# Status Page

View File

@ -40,6 +40,17 @@
# __PHP_PORT__
#
###
### Notes about Apache
###
#
# 1. Each same directive is checked in order of definition (last one wins)
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
# * Last match always takes precedence
#
# Exception: Directories, where shortest path is matched first
# Exception: ProxyPass and Alias first match and then stops
###
### Basic vHost skeleton
@ -55,10 +66,10 @@ vhost: |
__REDIRECT__
__SSL__
__VHOST_DOCROOT__
__VHOST_RPROXY__
__PHP_FPM__
__ALIASES__
__DENIES__
__VHOST_RPROXY__
__SERVER_STATUS__
# Custom directives
__CUSTOM__
@ -88,28 +99,40 @@ vhost_type:
# Reverse Proxy (-r http(s)://ADDR:PORT)
rproxy: |
# Define Reverse Proxy
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyAddHeaders: Add "X-Forward-*" headers
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
ProxyAddHeaders On
ProxyVia On
<Location __LOCATION__>
# Reverse Proxy
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</Location>
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
rproxy_ws: |
# Define Reverse Proxy with Websock support
ProxyRequests Off
<location __LOCATION__>
# ProxyRequests: Disable "Forward Proxy"
# ProxyPreserveHost: Pass "Host" header to remote
# ProxyAddHeaders: Add "X-Forward-*" headers
# ProxyVia: Add "Via" header
ProxyRequests Off
ProxyPreserveHost On
ProxyAddHeaders On
ProxyVia On
<Location __LOCATION__>
# Websocket Rewrite Settings
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule ^/?(.*)$ __WS_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/$1 [P,L]
# Reverse Proxy Settings
ProxyPreserveHost On
# Reverse Proxy
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</location>
</Location>
###
@ -169,10 +192,10 @@ features:
deny: |
# Deny Definition
<FilesMatch "__REGEX__">
<LocationMatch "__REGEX__">
Order allow,deny
Deny from all
</FilesMatch>
</LocationMatch>
server_status: |
# Status Page