Fix port 5000 conflict and nginx MIME type warnings
Browse files- frontend.py: read PORT env var instead of hardcoding 5000
(entrypoint starts frontend with PORT=5003, so dashboard keeps 5000)
- nginx.conf: remove sub_filter_types text/html from /fix/ and /frontend/
blocks — text/html is nginx sub_filter default, explicit declaration
caused duplicate MIME type warnings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- frontend/frontend.py +2 -1
- nginx.conf +0 -2
frontend/frontend.py
CHANGED
|
@@ -87,7 +87,8 @@ def trades():
|
|
| 87 |
return (r.text, r.status_code, {'Content-Type': 'application/json'})
|
| 88 |
|
| 89 |
if __name__ == '__main__':
|
| 90 |
-
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
@app.route('/submit', methods=['POST'])
|
|
|
|
| 87 |
return (r.text, r.status_code, {'Content-Type': 'application/json'})
|
| 88 |
|
| 89 |
if __name__ == '__main__':
|
| 90 |
+
port = int(os.getenv('PORT', '5000'))
|
| 91 |
+
app.run(host='0.0.0.0', port=port)
|
| 92 |
|
| 93 |
|
| 94 |
@app.route('/submit', methods=['POST'])
|
nginx.conf
CHANGED
|
@@ -28,7 +28,6 @@ http {
|
|
| 28 |
sub_filter 'href="/' 'href="/frontend/';
|
| 29 |
sub_filter 'action="/' 'action="/frontend/';
|
| 30 |
sub_filter_once off;
|
| 31 |
-
sub_filter_types text/html;
|
| 32 |
proxy_redirect / /frontend/;
|
| 33 |
}
|
| 34 |
|
|
@@ -41,7 +40,6 @@ http {
|
|
| 41 |
sub_filter 'href="/' 'href="/fix/';
|
| 42 |
sub_filter 'action="/' 'action="/fix/';
|
| 43 |
sub_filter_once off;
|
| 44 |
-
sub_filter_types text/html;
|
| 45 |
# Rewrite Location headers on Flask redirects
|
| 46 |
proxy_redirect / /fix/;
|
| 47 |
}
|
|
|
|
| 28 |
sub_filter 'href="/' 'href="/frontend/';
|
| 29 |
sub_filter 'action="/' 'action="/frontend/';
|
| 30 |
sub_filter_once off;
|
|
|
|
| 31 |
proxy_redirect / /frontend/;
|
| 32 |
}
|
| 33 |
|
|
|
|
| 40 |
sub_filter 'href="/' 'href="/fix/';
|
| 41 |
sub_filter 'action="/' 'action="/fix/';
|
| 42 |
sub_filter_once off;
|
|
|
|
| 43 |
# Rewrite Location headers on Flask redirects
|
| 44 |
proxy_redirect / /fix/;
|
| 45 |
}
|