I was trying trytond 5.2 with gunicorn and works well with tryton but not with sao. I worked before with uwsgi and works without the need to has CORS configured, but with gunicorn doesn’t work.
Could you explain your setup and why you think you need CORS?
The configuration of CORS should not be needed for sao as long as it is distributed from the same hostname as trytond (indeed sao should not work otherwise with or without CORS).
The configuration for CORS should look like:
The config with uwsgi works on tryton 5.0, 5.2 and 5.4 and sao 5.0, 5.2, 5.4 using nginx as proxy server.
Using nginx as proxy server the given config with gunicorn works with tryton 5.0, 5.2, 5.4 and sao 5.0. With sao 5.2 and 5.4 gives the follow traceback:
File "/opt/test/lib/python3.7/site-packages/trytond/wsgi.py", line 181, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/test/lib/python3.7/site-packages/trytond/wsgi.py", line 187, in __call__
return self.app(environ, start_response)
File "/opt/test/lib/python3.7/site-packages/trytond/wsgi.py", line 159, in wsgi_app
abort(HTTPStatus.FORBIDDEN)
File "/opt/test/lib/python3.7/site-packages/werkzeug/exceptions.py", line 772, in abort
return _aborter(status, *args, **kwargs)
File "/opt/test/lib/python3.7/site-packages/werkzeug/exceptions.py", line 753, in __call__
raise self.mapping[code](*args, **kwargs)
werkzeug.exceptions.Forbidden: 403 Forbidden: You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.
I configured cors similar to these but doesn’t work neither.