-
-
Notifications
You must be signed in to change notification settings - Fork 130
fix CORS support for reverse web proxy deployments #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: testing
Are you sure you want to change the base?
Conversation
auto_rx 1.8.0 release - Full ka9q-radio support!
v1.8.1 Release - RS41 Multi-GNSS Support, ka9q-radio updates
Why is CORS necessary? Shouldn't all the content be loaded from the same origin, from the browser's perspective? |
@kx1t can you please provide a har recording for stock radiosonde autorx (eg when cors is failing) |
@xssfox note that both my web proxy and the auto_rx instance for my site allow '*' for CORS, so overwriting the CORS header probably doesn't / shouldn't do anything as it's set to accept anything. The instances that I have deployed all include the fix of this PR already. From what I read online, the CORS permissions should be added in any case -- they won't hurt for non-rwp deployments, and they will ensure that rwp deployments work error-free |
Why? CORS is only needed in cases where you want to allow another website ("origin") to access content served by yours, and that shouldn't be the case for reverse web proxy deployments where everything is served from the proxy's origin. |
|
I was overwriting it to simulate no cors header to demonstrate that it works fine without. |
This fixes CORS support for use with SSL via reverse web proxies (like
nginx
) (further: "rwp") for container deployments. The fix was tested both via a rwp, as well as directly to ensure it doesn't break any non-webproxy deployments.Specifically, it adds the Python flask-cors module to the container and applies CORS enhancements to the creation of the app and the socketio.
This fix does NOT fix the issue/complexity of having websockets work via a rwp -- the transport mechanism will fall back to http(s) polling. However, this works fine.
How to test --
nginx
with the followinglocation
definition (and radiosonde_auto_rx is deployed at http://10.244.95.84:88/):Last -- I additionally tested the enhancement that was suggested in #834 to change
app.wsgi_app
in web.py to:Unfortunately, that completely breaks socketio connections - the app works fine with the current code around
app.wsgi_app