<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName example.com
ServerAdmin m...@example.com
<Proxy *>
AuthType Basic
AuthUserFile /data/passwords/passwords.pwd
AuthName "myDemoApp"
<RequireAll>
Require valid-user
</RequireAll>
</proxy>
<Location "/">
ProxyPass "http://example.com:8001/"
ProxyPassReverse "http://example.com:8001/"
RequestHeader set X-Forwarded-Proto "https"
</Location>
:
</VirtualHost>
</IfModule>
mod_wsgi-express setup-server /data/website/myApp/wsgi.py \
--reload-on-changes \
--port 8001 \
--user www-data --group www-data \
--server-root /var/www/my_app \
--log-level info \
--access-log <Location "/"> to <Location "/bla/">. Not when I open the website at https://example.com I get the Apache2 Default Page, which is what I would expect. But when I try to open https://example.com/bla/ it simply doesn't load the website (no error or something, just the Loading...). I don't get any error, neither in the frontend nor in the backend log.--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/889266ce-91e2-4ac3-a9ed-0fd13e6d9ed6%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/f5461cdd-e62a-4764-9216-ef7bf47da5e8%40googlegroups.com.
So what happens when you access the backend directly?
On 2 Apr 2020, at 5:49 pm, rmoo...@gmx.net wrote:
Thank you Graham, me setup is based on the blog posts you suggested. I started out with the ProxyPass not inside of Location and then tried all kinds of combinations, with no success. I had tried the following:
ProxyPass /bla "http://example.com:8001/"
ProxyPassReverse /bla "http://example.com:8001/"
RequestHeader set X-Forwarded-Proto "https"
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/f5461cdd-e62a-4764-9216-ef7bf47da5e8%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/218165cc-50d2-4f2b-8989-9167b3127a6f%40googlegroups.com.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>My title</title>
<link rel="icon" type="image/x-icon" href="/_favicon.ico?v=1.4.1">
<link rel="stylesheet" href="https://codepen.io/chriddyp/pen/bWLwgP.css">
<link rel="stylesheet" href="/assets/style.css">
<link rel="stylesheet" href="/assets/style.css?m=1585731972.8701963">
</head>
<body>
<div id="react-entry-point">
<div class="_dash-loading">
Loading...
</div>
</div>
<footer>
<script id="_dash-config" type="application/json">{"url_base_pathname": null, "requests_pathname_prefix": "/", "ui": false, "props_check": false, "show_undo_redo": false}</script>
<script src="/_dash-component-suites/dash_renderer/re...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/reac...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_core_components/plotly-1.50.1.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/highlight.pack.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/dash_core_components.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_html_components/dash_html_components.min.js?v=1.0.1&m=1576596177"></script>
<script src="/_dash-component-suites/dash_renderer/dash_renderer.min.js?v=1.1.2&m=1576595738"></script>
<script id="_dash-renderer" type="application/javascript">var renderer = new DashRenderer();</script>
</footer>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>My title</title>
<link rel="icon" type="image/x-icon" href="/_favicon.ico?v=1.4.1">
<link rel="stylesheet" href="https://codepen.io/chriddyp/pen/bWLwgP.css">
<link rel="stylesheet" href="/assets/style.css">
<link rel="stylesheet" href="/assets/style.css?m=1585731972.8701963">
</head>
<body>
<div id="react-entry-point">
<div class="_dash-loading">
Loading...
</div>
</div>
<footer>
<script id="_dash-config" type="application/json">{"url_base_pathname": null, "requests_pathname_prefix": "/", "ui": false, "props_check": false, "show_undo_redo": false}</script>
<script src="/_dash-component-suites/dash_renderer/re...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/reac...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_core_components/plotly-1.50.1.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/highlight.pack.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/dash_core_components.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_html_components/dash_html_components.min.js?v=1.0.1&m=1576596177"></script>
<script src="/_dash-component-suites/dash_renderer/dash_renderer.min.js?v=1.1.2&m=1576595738"></script>
<script id="_dash-renderer" type="application/javascript">var renderer = new DashRenderer();</script>
</footer>
</body>
</html>[Thu Apr 02 10:50:17.240939 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of <RequireAny>: granted
[Thu Apr 02 10:50:17.241057 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of Require all granted: granted
[Thu Apr 02 10:50:17.241070 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of <RequireAny>: grantedTo view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/trinity-16397838-77af-4d30-93a8-8e9ab4fbf39d-1585821663425%403c-app-gmx-bap75.
# config "/"
# config "/bla"
ProxyPass /bla http://example.com:8001/bla
ProxyPassReverse /bla http://example.com:8001/bla
# general
RequestHeader set X-Forwarded-Port 443
RequestHeader set X-Forwarded-Scheme https
mod_wsgi-express setup-server /data/website/myApp/wsgi.py \
--reload-on-changes \
--port 8001 \
--user www-data --group www-data \
--server-root /var/www/my_app \
--log-level debug \
--access-log \
--trust-proxy-header X-Forwarded-Host \
--trust-proxy-header X-Forwarded-Port \
--trust-proxy-header X-Forwarded-For \
--trust-proxy-header X-Forwarded-Schememod_wsgi-express setup-server /data/website/myApp/wsgi.py \
--reload-on-changes \
--port 8001 \
--user www-data --group www-data \
--server-root /var/www/my_app \
--log-level debug \
--access-log \
--trust-proxy-header X-Forwarded-Host \
--trust-proxy-header X-Forwarded-Port \
--trust-proxy-header X-Forwarded-For \
--trust-proxy-header X-Forwarded-Scheme \
--mount-point /bla
<script src="/_dash-component-suites/dash_renderer/react-dom@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-types@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/react-dom@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-types@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_core_components/plotly-1.50.1.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/highlight.pack.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_core_components/dash_core_components.min.js?v=1.3.1&m=1576595950"></script>
<script src="/_dash-component-suites/dash_html_components/dash_html_components.min.js?v=1.0.1&m=1576596177"></script>
<script src="/_dash-component-suites/dash_renderer/dash_renderer.min.js?v=1.1.2&m=1576595738"></script>
<script id="_dash-renderer" type="application/javascript">var renderer = new DashRenderer();</script>
</footer>
</body>
</html>
The both look pretty much the same to me, except that if I access it with the browser it gets stuck at "Loading..." when I go via the proxy.
I set the log level to debug on the backend server and that works (I can see some debug messages in the error log from the startup). When I do curl http://example.com:8001 I get the following:[Thu Apr 02 10:50:17.240939 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of <RequireAny>: granted
[Thu Apr 02 10:50:17.241057 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of Require all granted: granted
[Thu Apr 02 10:50:17.241070 2020] [authz_core:debug] [pid 11192:tid 139984647812864] mod_authz_core.c(820): [client 127.0.0.1:39026] AH01626: authorization result of <RequireAny>: granted
But when I do curl -u user:password https://example.com/bla I don't get a new entry in the log file.Do you know what that means and how I can fix it?
Gesendet: Donnerstag, 02. April 2020 um 10:09 Uhr
Von: "Graham Dumpleton" <graham....@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/218165cc-50d2-4f2b-8989-9167b3127a6f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/5824B189-06E7-406C-A16E-52D9A49E29F2%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/trinity-16397838-77af-4d30-93a8-8e9ab4fbf39d-1585821663425%403c-app-gmx-bap75.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/85fbfdb4-f239-4309-95b2-7f998bb9efe1%40googlegroups.com.
mod_wsgi-express setup-server /data/website/myApp/wsgi.py \
--reload-on-changes \
--port 8001 \
--user www-data \
--group www-data \
--server-root /var/www/my_app \
--access-log \
--mount-point /bla \
--trust-proxy-header X-Forwarded-Host \
--trust-proxy-header X-Forwarded-Port \
--trust-proxy-header X-Forwarded-For \
--trust-proxy-header X-Forwarded-Scheme<VirtualHost _default_:443>
[...]
<Proxy *>
AuthType Basic
AuthUserFile /data/passwords/passwords.pwd
AuthName "myDemoApp"
<RequireAll>
Require valid-user
</RequireAll>
</proxy>
ProxyPass /bla http://example.com:8001/bla
ProxyHTMLURLMap http://example.com:8001 /bla
<Location /bla/>
ProxyPassReverse /
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port 443
ProxyHTMLEnable On
ProxyHTMLExtended On
ProxyHTMLURLMap / /bla/
RequestHeader unset Accept-Encoding
</Location>
[...]
</VirtualHost>ProxyHTMLEnable, ProxyHTMLExtended, ProxyHTMLExtended, and ProxyHTMLURLMap).ProxyHTMLExtended On. As pointed out in the documentation, this is not ideal and can cause problems.Try also:--mount-point /bla/
<script src="/_dash-component-suites/dash_renderer/reac...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/reac...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/trinity-2f93db63-8850-4113-8a0e-da0071bc4a8c-1586282795652%403c-app-gmx-bs67.
Graham
Von: "Graham Dumpleton" <graham....@gmail.com>
An: mod...@googlegroups.com
Betreff: Re: [modwsgi] Apache proxy and mod_wsgi-express
Try also:--mount-point /bla/
<script src="/_dash-component-suites/dash_renderer/react-d...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-ty...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/react-d...@16.8.6.min.js?v=1.1.2&m=1576595738"></script>
<script src="/_dash-component-suites/dash_renderer/prop-ty...@15.7.2.min.js?v=1.1.2&m=1576595738"></script>
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/85fbfdb4-f239-4309-95b2-7f998bb9efe1%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/41CC045F-D933-4668-B14F-A77329AA6A17%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/trinity-2f93db63-8850-4113-8a0e-da0071bc4a8c-1586282795652%403c-app-gmx-bs67.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/eba35b71-8ad8-4ffb-b6b8-3ea601478123%40googlegroups.com.
/myapplication instead of /, url_for() properly handles that for you.