|
1 | | ---- |
2 | | - |
3 | | -# |
4 | | -# Slightly modified version of the nginx template to fix Reverse Proxy |
5 | | -# ProxyHTMLMap is not available on this version of Apache 2.2 |
6 | | -# |
7 | | -# Search this file for 'CHANGED:' |
8 | | -# |
9 | | -# |
10 | | - |
11 | | -# Apache 2.2 vHost Template defintion for vhost-gen.py |
12 | | -# |
13 | | -# The 'feature' section contains optional features that can be enabled via |
14 | | -# conf.yml and will then be replaced into the main vhost ('structure' section) |
15 | | -# into their corresponding position: |
16 | | -# |
17 | | -# __XDOMAIN_REQ__ |
18 | | -# __PHP_FPM__ |
19 | | -# __ALIASES__ |
20 | | -# __DENIES__ |
21 | | -# __STATUS__ |
22 | | -# |
23 | | -# The features itself also contain variables to be adjusted in conf.yml |
24 | | -# and will then be replaced in their corresponding feature section |
25 | | -# before being replaced into the vhost section (if enabled): |
26 | | -# |
27 | | -# PHP-FPM: |
28 | | -# __PHP_ADDR__ |
29 | | -# __PHP_PORT__ |
30 | | -# XDomain: |
31 | | -# __REGEX__ |
32 | | -# Alias: |
33 | | -# __REGEX__ |
34 | | -# __PATH__ |
35 | | -# Deny: |
36 | | -# __REGEX__ |
37 | | -# Status: |
38 | | -# __REGEX__ |
39 | | -# |
40 | | -# Variables to be replaced directly in the vhost configuration can also be set |
41 | | -# in conf.yml and include: |
42 | | -# __VHOST_NAME__ |
43 | | -# __DOCUMENT_ROOT__ |
44 | | -# __INDEX__ |
45 | | -# __ACCESS_LOG__ |
46 | | -# __ERROR_LOG__ |
47 | | -# __PHP_ADDR__ |
48 | | -# __PHP_PORT__ |
49 | | -# |
50 | | - |
51 | | - |
52 | | -### |
53 | | -### Basic vHost skeleton |
54 | | -### |
55 | | -vhost: | |
56 | | - <VirtualHost __DEFAULT_VHOST__:__PORT__> |
57 | | - ServerName __VHOST_NAME__ |
58 | | -
|
59 | | - CustomLog "__ACCESS_LOG__" combined |
60 | | - ErrorLog "__ERROR_LOG__" |
61 | | -
|
62 | | - __REDIRECT__ |
63 | | - __SSL__ |
64 | | - __VHOST_DOCROOT__ |
65 | | - __VHOST_RPROXY__ |
66 | | - __PHP_FPM__ |
67 | | - __ALIASES__ |
68 | | - __DENIES__ |
69 | | - __SERVER_STATUS__ |
70 | | - # Custom directives |
71 | | - __CUSTOM__ |
72 | | - </VirtualHost> |
73 | | -
|
74 | | -### |
75 | | -### vHost Type (normal or reverse proxy) |
76 | | -### |
77 | | -vhost_type: |
78 | | - # Normal vHost (-p) |
79 | | - docroot: | |
80 | | - # Define the vhost to serve files |
81 | | - DocumentRoot "__DOCUMENT_ROOT__" |
82 | | - <Directory "__DOCUMENT_ROOT__"> |
83 | | - DirectoryIndex __INDEX__ |
84 | | -
|
85 | | - AllowOverride All |
86 | | - Options All |
87 | | -
|
88 | | - RewriteEngine on |
89 | | - RewriteBase / |
90 | | -
|
91 | | - Order allow,deny |
92 | | - Allow from all |
93 | | - </Directory> |
94 | | -
|
95 | | - # Reverse Proxy (-r) |
96 | | - rproxy: | |
97 | | - # Define the vhost to reverse proxy |
98 | | - ProxyRequests off |
99 | | - ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__ |
100 | | - # CHANGED: |
101 | | - #ProxyHTMLURLMap __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__ __LOCATION__ |
102 | | - # end of CHANGED: |
103 | | - <location __LOCATION__> |
104 | | - ProxyPassReverse / |
105 | | - # CHANGED: |
106 | | - #SetOutputFilter proxy-html |
107 | | - #ProxyHTMLURLMap / __LOCATION__ |
108 | | - #ProxyHTMLURLMap __LOCATION__ __LOCATION__ |
109 | | - # end of CHANGED: |
110 | | - RequestHeader unset Accept-Encoding |
111 | | - </location> |
112 | | -
|
113 | | -
|
114 | | -### |
115 | | -### Optional features to be enabled in vHost |
116 | | -### |
117 | | -features: |
118 | | - |
119 | | - # SSL Configuration |
120 | | - ssl: | |
121 | | - SSLEngine on |
122 | | - SSLCertificateFile "__SSL_PATH_CRT__" |
123 | | - SSLCertificateKeyFile "__SSL_PATH_KEY__" |
124 | | - SSLProtocol __SSL_PROTOCOLS__ |
125 | | - SSLHonorCipherOrder __SSL_HONOR_CIPHER_ORDER__ |
126 | | - SSLCipherSuite __SSL_CIPHERS__ |
127 | | -
|
128 | | - # Redirect to SSL directive |
129 | | - redirect: | |
130 | | - RedirectMatch (.*) https://__VHOST_NAME__:__SSL_PORT__$1 |
131 | | -
|
132 | | - # PHP-FPM will not be applied to a reverse proxy! |
133 | | - php_fpm: | |
134 | | - # PHP-FPM Definition |
135 | | - ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://__PHP_ADDR__:__PHP_PORT____DOCUMENT_ROOT__/$1 timeout=__PHP_TIMEOUT__ |
136 | | -
|
137 | | - alias: | |
138 | | - # Alias Definition |
139 | | - Alias "__ALIAS__" "__PATH____ALIAS__" |
140 | | - <Location "__ALIAS__"> |
141 | | - __XDOMAIN_REQ__ |
142 | | - </Location> |
143 | | - <Directory "__PATH____ALIAS__"> |
144 | | - Order allow,deny |
145 | | - Allow from all |
146 | | - </Directory> |
147 | | -
|
148 | | - deny: | |
149 | | - # Deny Definition |
150 | | - <FilesMatch "__REGEX__"> |
151 | | - Order allow,deny |
152 | | - Deny from all |
153 | | - </FilesMatch> |
154 | | -
|
155 | | - server_status: | |
156 | | - # Status Page |
157 | | - <Location __REGEX__> |
158 | | - SetHandler server-status |
159 | | - Order allow,deny |
160 | | - Allow from all |
161 | | - </Location> |
162 | | -
|
163 | | - xdomain_request: | |
164 | | - # Allow cross domain request from these hosts |
165 | | - SetEnvIf Origin "__REGEX__" AccessControlAllowOrigin=$0 |
166 | | - Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin |
167 | | - Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" |
168 | | - Header always set Access-Control-Max-Age "0" |
169 | | - Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token" |
170 | | - # Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request. |
171 | | - RewriteEngine On |
172 | | - RewriteCond %{REQUEST_METHOD} OPTIONS |
173 | | - RewriteRule ^(.*)$ $1 [R=200,L] |
0 commit comments