Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos
Commits
b067406d
Commit
b067406d
authored
Jun 01, 2018
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Implement global catch-all with 404
404 is served with notfound.html
parent
4300660a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
30 deletions
+24
-30
software/caddy-frontend/buildout.hash.cfg
software/caddy-frontend/buildout.hash.cfg
+5
-5
software/caddy-frontend/instance-apache-frontend.cfg
software/caddy-frontend/instance-apache-frontend.cfg
+3
-2
software/caddy-frontend/templates/Caddyfile.in
software/caddy-frontend/templates/Caddyfile.in
+12
-22
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
.../caddy-frontend/templates/apache-custom-slave-list.cfg.in
+1
-0
software/caddy-frontend/templates/template-log-access.conf.in
...ware/caddy-frontend/templates/template-log-access.conf.in
+3
-1
No files found.
software/caddy-frontend/buildout.hash.cfg
View file @
b067406d
...
...
@@ -18,7 +18,7 @@ md5sum = 906e5bd66b1265b8109a86b6ab46e91f
[template-apache-frontend]
filename = instance-apache-frontend.cfg
md5sum =
6ed51a3629d8eca72fc58cda652aea19
md5sum =
8a32eebd4dcdbed9442ebbfd64a0fab1
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
...
...
@@ -26,7 +26,7 @@ md5sum = 361054e6566461e728ee62e2835904f9
[template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
md5sum =
353d68f9ba6a318fd7ce0461d3bbc2c7
md5sum =
904084604341fe8eb00d493cd05e46c0
[template-slave-configuration]
filename = templates/custom-virtualhost.conf.in
...
...
@@ -38,11 +38,11 @@ md5sum = 665e83d660c9b779249b2179d7ce4b4e
[template-caddy-frontend-configuration]
filename = templates/Caddyfile.in
md5sum =
a8765b3c3af9f4f4f6437028aa42c58f
md5sum =
66975b5c3c3544c365b93e2ae58531f8
[template-custom-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
md5sum =
353d68f9ba6a318fd7ce0461d3bbc2c7
md5sum =
904084604341fe8eb00d493cd05e46c0
[template-not-found-html]
filename = templates/notfound.html
...
...
@@ -58,7 +58,7 @@ md5sum = 7a1fa1239f29cf1a3f6f578f6ff05ca3
[template-log-access]
filename = templates/template-log-access.conf.in
md5sum =
fae1e2fc29c061f7bbb455b9efb9c3b3
md5sum =
0867232c154e427b9e0f1af7fd694ebb
[template-empty]
filename = templates/empty.in
...
...
software/caddy-frontend/instance-apache-frontend.cfg
View file @
b067406d
...
...
@@ -201,6 +201,7 @@ extra-context =
key error_log caddy-configuration:error-log
raw sixtunnel_executable ${6tunnel:location}/bin/6tunnel
raw service_directory $${directory:service}
key not_found_file caddy-configuration:not-found-file
[dynamic-virtualhost-template-slave]
<= jinja2-template-base
...
...
@@ -221,7 +222,6 @@ rendered = $${caddy-configuration:frontend-configuration}
extra-context =
key httpd_home software-release-path:caddy-location
key httpd_mod_ssl_cache_directory caddy-directory:mod-ssl
key document_root caddy-directory:document-root
key instance_home buildout:directory
key server_admin instance-parameter:configuration.server-admin
key login_certificate ca-frontend:cert-file
...
...
@@ -240,6 +240,7 @@ extra-context =
key local_ipv4 instance-parameter:ipv4-random
key global_ipv6 slap-network-information:global-ipv6
key error_log caddy-configuration:error-log
key not_found_file caddy-configuration:not-found-file
key username slap-parameter:monitor-username
key password slap-parameter:monitor-password
...
...
@@ -286,7 +287,7 @@ error-log = $${directory:log}/frontend-error.log
pid-file = $${directory:run}/httpd.pid
frontend-configuration-verification = $${caddy-wrapper:rendered} -validate > /dev/null
frontend-graceful-command = $${:frontend-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${:pid-file}); fi
not-found-file = $${caddy-directory:document-root}/notfound.html
# Comunication with ats
cache-port = $${trafficserver-variable:input-port}
cache-through-port = 26011
...
...
software/caddy-frontend/templates/Caddyfile.in
View file @
b067406d
# Automatically generated
# As backend is trusting REMOTE_USER header unset it always
# TODO-Caddy RequestHeader unset REMOTE_USER
# TODO-Caddy <Directory {{ document_root }}>
# TODO-Caddy Require all granted
# TODO-Caddy Options -Indexes
# TODO-Caddy ErrorDocument 404 /notfound.html
# TODO-Caddy RewriteEngine on
# TODO-Caddy RewriteRule ^/?$ notfound.html [R=404,L]
# TODO-Caddy </Directory>
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
# TODO-Caddy BrowserMatch "Mozilla/2" nokeepalive
...
...
@@ -57,14 +46,16 @@ import {{frontend_configuration.get('log-access-configuration')}}
import {{ slave_configuration_directory }}/*.conf
import {{ slave_with_cache_configuration_directory }}/*.conf
https://[{{ global_ipv6 }}]:{{ https_port }}/, https://{{ local_ipv4 }}:{{ https_port }}/
{
:{{ https_port }}
{
tls {{ login_certificate }} {{ login_key }}
bind {{ local_ipv4 }}
status 404 /
# TODO-Caddy LogLevel notice
# TODO-Caddy LogFormat "%h %l %{REMOTE_USER}i %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
log / {{ access_log }} {combined}
errors {{ error_log }}
errors {{ error_log }} {
* {{ not_found_file }}
}
}
https://[{{ global_ipv6 }}]:{{ https_port }}/server-status, https://{{ local_ipv4 }}:{{ https_port }}/server-status {
...
...
@@ -79,17 +70,16 @@ https://[{{ global_ipv6 }}]:{{ https_port }}/server-status, https://{{ local_ipv
# TODO-Caddy LogLevel notice
# TODO-Caddy LogFormat "%h %l %{REMOTE_USER}i %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
log / {{ access_log }} {combined}
errors {{ error_log }}
errors {{ error_log }} {
* {{ not_found_file }}
}
}
http://[{{ global_ipv6 }}]:{{ http_port }}/, http://{{ local_ipv4 }}:{{ http_port }}/
{
:{{ http_port }}
{
bind {{ local_ipv4 }}
status 404 /
# TODO-Caddy LogLevel notice
# TODO-Caddy LogFormat "%h %l %{REMOTE_USER}i %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
log / {{ access_log }} {combined
}
errors {{ error_log }
}
log / {{ access_log }} "{remote} {>REMOTE_USER} [{when}] \"{method} {uri} {proto}\" {status} {size} \"{>Referer}\" \"{>User-Agent}\" {latency_ms}"
errors {{ error_log }} {
* {{ not_found_file }
}
}
}
# TODO-Caddy ErrorDocument 404 /notfound.html
# TODO-Caddy RewriteRule (.*) /notfound.html [R=404,L]
software/caddy-frontend/templates/apache-custom-slave-list.cfg.in
View file @
b067406d
...
...
@@ -380,6 +380,7 @@ extra-context =
raw login_key {{ login_key }}
raw access_log {{ access_log }}
raw error_log {{ error_log }}
raw not_found_file {{ not_found_file }}
{# Publish information for the instance #}
[publish-caddy-information]
...
...
software/caddy-frontend/templates/template-log-access.conf.in
View file @
b067406d
...
...
@@ -11,6 +11,8 @@ https://[{{ global_ipv6 }}]:{{ https_port }}/{{ slave }}, https://{{ local_ipv4
# TODO-Caddy LogLevel notice
# TODO-Caddy LogFormat "%h %l %{REMOTE_USER}i %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
log / {{ access_log }} {combined}
errors {{ error_log }}
errors {{ error_log }} {
* {{ not_found_file }}
}
}
{% endfor %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment