Update vhost-gen templates

This commit is contained in:
cytopia 2022-12-26 16:03:05 +01:00
parent a786eb64b0
commit a1fa5724e8
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
6 changed files with 84 additions and 24 deletions

View File

@ -46,10 +46,10 @@ vhost: |
ErrorLog "__ERROR_LOG__"
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
ProxyRequests On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://php:8000/
ProxyPassReverse / http://php:8000/
ProxyPass / http://php:8000/ retry=0
ProxyPassReverse / http://php:8000/
__REDIRECT__
__SSL__
@ -92,6 +92,7 @@ features:
# Alias Definition
Alias "__ALIAS__" "__PATH____ALIAS__"
<Location "__ALIAS__">
ProxyPass !
__XDOMAIN_REQ__
</Location>
<Directory "__PATH____ALIAS__">

View File

@ -54,10 +54,10 @@ vhost: |
__REDIRECT__
__SSL__
__VHOST_DOCROOT__
__VHOST_RPROXY__
__PHP_FPM__
__ALIASES__
__DENIES__
__VHOST_RPROXY__
__SERVER_STATUS__
# Custom directives
__CUSTOM__
@ -84,13 +84,30 @@ vhost_type:
Allow from all
</Directory>
# Reverse Proxy (-r)
# Reverse Proxy (-r http(s)://ADDR:PORT)
rproxy: |
# Define the vhost to reverse proxy
ProxyRequests On
# Define Reverse Proxy
ProxyRequests Off
ProxyPreserveHost On
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
rproxy_ws: |
# Define Reverse Proxy with Websock support
ProxyRequests Off
ProxyPreserveHost 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
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</location>
###
@ -120,6 +137,7 @@ features:
# Alias Definition
Alias "__ALIAS__" "__PATH____ALIAS__"
<Location "__ALIAS__">
ProxyPass !
__XDOMAIN_REQ__
</Location>
<Directory "__PATH____ALIAS__">

View File

@ -47,10 +47,10 @@ vhost: |
ErrorLog "__ERROR_LOG__"
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
ProxyRequests On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://php:8000/
ProxyPassReverse / http://php:8000/
ProxyPass / http://php:8000/ retry=0
ProxyPassReverse / http://php:8000/
__REDIRECT__
__SSL__
@ -93,6 +93,7 @@ features:
# Alias Definition
Alias "__ALIAS__" "__PATH____ALIAS__"
<Location "__ALIAS__">
ProxyPass !
__XDOMAIN_REQ__
</Location>
<Directory "__PATH____ALIAS__">

View File

@ -55,10 +55,10 @@ vhost: |
__REDIRECT__
__SSL__
__VHOST_DOCROOT__
__VHOST_RPROXY__
__PHP_FPM__
__ALIASES__
__DENIES__
__VHOST_RPROXY__
__SERVER_STATUS__
# Custom directives
__CUSTOM__
@ -86,13 +86,30 @@ vhost_type:
Require all granted
</Directory>
# Reverse Proxy (-r)
# Reverse Proxy (-r http(s)://ADDR:PORT)
rproxy: |
# Define the vhost to reverse proxy
ProxyRequests On
# Define Reverse Proxy
ProxyRequests Off
ProxyPreserveHost On
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
rproxy_ws: |
# Define Reverse Proxy with Websock support
ProxyRequests Off
<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
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
</location>
###
@ -141,6 +158,7 @@ features:
# Alias Definition
Alias "__ALIAS__" "__PATH____ALIAS__"
<Location "__ALIAS__">
ProxyPass !
__XDOMAIN_REQ__
</Location>
<Directory "__PATH____ALIAS__">

View File

@ -48,8 +48,11 @@ vhost: |
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# https://stackoverflow.com/a/72586833
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Proxy connection
proxy_pass http://php:8000;
}

View File

@ -75,12 +75,31 @@ vhost_type:
root "__DOCUMENT_ROOT__";
index __INDEX__;
# Reverse Proxy (-r)
# Reverse Proxy (-r http(s)://ADDR:PORT)
rproxy: |
# Define the vhost to reverse proxy
# Define Reverse Proxy
location __LOCATION__ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# https://stackoverflow.com/a/72586833
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Proxy connection
proxy_pass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__;
}
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
rproxy_ws: |
# Define Reverse Proxy with Websock support
location __LOCATION__ {
# https://stackoverflow.com/a/72586833
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Websocket settings
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# Proxy connection
proxy_pass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__;
}