Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
1a74b81f
Commit
1a74b81f
authored
Jul 09, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new nginx configuration yaml file to allow proxying of whole domains elsewhere
parent
04e30ffa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
nginx.conf
conf/nginx.conf
+2
-0
web_update.py
management/web_update.py
+15
-1
No files found.
conf/nginx.conf
View file @
1a74b81f
...
@@ -52,5 +52,7 @@ server {
...
@@ -52,5 +52,7 @@ server {
fastcgi_param
SCRIPT_FILENAME
/usr/local/bin/mailinabox-webfinger.php
;
fastcgi_param
SCRIPT_FILENAME
/usr/local/bin/mailinabox-webfinger.php
;
fastcgi_pass
unix:/tmp/php-fastcgi.www-data.sock
;
fastcgi_pass
unix:/tmp/php-fastcgi.www-data.sock
;
}
}
# ADDITIONAL DIRECTIVES HERE
}
}
management/web_update.py
View file @
1a74b81f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# domains for which a mail account has been set up.
# domains for which a mail account has been set up.
########################################################################
########################################################################
import
os
,
os
.
path
import
os
,
os
.
path
,
re
,
rtyaml
from
mailconfig
import
get_mail_domains
from
mailconfig
import
get_mail_domains
from
utils
import
shell
,
safe_domain_name
,
sort_domains
from
utils
import
shell
,
safe_domain_name
,
sort_domains
...
@@ -67,6 +67,20 @@ def make_domain_config(domain, template, env):
...
@@ -67,6 +67,20 @@ def make_domain_config(domain, template, env):
nginx_conf
=
nginx_conf
.
replace
(
"$ROOT"
,
root
)
nginx_conf
=
nginx_conf
.
replace
(
"$ROOT"
,
root
)
nginx_conf
=
nginx_conf
.
replace
(
"$SSL_KEY"
,
ssl_key
)
nginx_conf
=
nginx_conf
.
replace
(
"$SSL_KEY"
,
ssl_key
)
nginx_conf
=
nginx_conf
.
replace
(
"$SSL_CERTIFICATE"
,
ssl_certificate
)
nginx_conf
=
nginx_conf
.
replace
(
"$SSL_CERTIFICATE"
,
ssl_certificate
)
# Add in any user customizations.
nginx_conf_parts
=
re
.
split
(
"(# ADDITIONAL DIRECTIVES HERE
\n
)"
,
nginx_conf
)
nginx_conf_custom_fn
=
os
.
path
.
join
(
env
[
"STORAGE_ROOT"
],
"www/custom.yaml"
)
if
os
.
path
.
exists
(
nginx_conf_custom_fn
):
yaml
=
rtyaml
.
load
(
open
(
nginx_conf_custom_fn
))
if
domain
in
yaml
:
yaml
=
yaml
[
domain
]
if
"proxy"
in
yaml
:
nginx_conf_parts
[
1
]
+=
"
\t
location / {
\n\t\t
proxy_pass
%
s;
\n\t
}
\n
"
%
yaml
[
"proxy"
]
# Put it all together.
nginx_conf
=
""
.
join
(
nginx_conf_parts
)
return
nginx_conf
return
nginx_conf
def
get_web_root
(
domain
,
env
):
def
get_web_root
(
domain
,
env
):
...
...
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