Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
mutalyzer
Commits
c30037de
Commit
c30037de
authored
10 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Add REVERSE_PROXIED configuration setting
parent
511f03c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mutalyzer/config/default_settings.py
+6
-0
6 additions, 0 deletions
mutalyzer/config/default_settings.py
mutalyzer/website/__init__.py
+4
-12
4 additions, 12 deletions
mutalyzer/website/__init__.py
with
10 additions
and
12 deletions
mutalyzer/config/default_settings.py
+
6
−
0
View file @
c30037de
...
...
@@ -25,6 +25,12 @@ MAX_CACHE_SIZE = 50 * 1048576 # 50 MB
# Maximum size for uploaded and downloaded files (in bytes).
MAX_FILE_SIZE
=
10
*
1048576
# 10 MB
# The WSGI application runs behind a reverse proxy (e.g., nginx using
# proxy_pass). This needs to be set if the application is mapped to a URL
# other than / or a different HTTP scheme is used by the reverse proxy.
# http://flask.pocoo.org/snippets/35/
REVERSE_PROXIED
=
False
# Redis connection URI (can be any redis-py connection URI). Set to `None` to
# silently use a mock Redis. Redis is only used for non-essential features.
REDIS_URI
=
None
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/website/__init__.py
+
4
−
12
View file @
c30037de
...
...
@@ -14,7 +14,7 @@ from mutalyzer.db import session
# Todo: Perhaps we also need this for the RPC services?
class
ReverseProxied
(
object
):
class
_
ReverseProxied
(
object
):
"""
Wrap the application in this middleware and configure the front-end server
to add these headers, to let you quietly bind this to a URL other than /
...
...
@@ -62,6 +62,9 @@ def create_app():
template_folder
=
os
.
path
.
abspath
(
template_folder
),
static_folder
=
os
.
path
.
abspath
(
static_folder
))
if
settings
.
REVERSE_PROXIED
:
app
.
wsgi_app
=
_ReverseProxied
(
app
.
wsgi_app
)
app
.
config
.
update
(
DEBUG
=
settings
.
DEBUG
,
TESTING
=
settings
.
TESTING
,
MAX_CONTENT_LENGTH
=
settings
.
MAX_FILE_SIZE
)
...
...
@@ -80,14 +83,3 @@ def create_app():
session
.
remove
()
return
app
def
create_reverse_proxied_app
():
"""
Create a Flask instance for Mutalyzer running behind a reverse proxy.
See :func:`create_app` and :class:`ReverseProxied`.
"""
app
=
create_app
()
app
.
wsgi_app
=
ReverseProxied
(
app
.
wsgi_app
)
return
app
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment