gschuurman commented on issue #49781:
URL: https://github.com/apache/airflow/issues/49781#issuecomment-2906624752

   > Hi [@gschuurman](https://github.com/gschuurman)! Could you please share 
`webserver_config.py` file with `ProxyFix`. I am not sure what should be the 
value of `conf` in `webserver_config.py` file
   
   I cannot share my entire `webserver_config.py` because there are some 
role-mappings in there. But adding this snippet on the top of your 
`webserver_config.py` should do the trick.
   
   Keep in mind that it's now using the fab config section to make sure that 
it's compatible with the next apache-airflow-providers-fab release.
   
   ```python
   from airflow.configuration import conf
   from flask_appbuilder.security.manager import AUTH_OAUTH
   from werkzeug.middleware.proxy_fix import ProxyFix
   
   
   AUTH_TYPE = AUTH_OAUTH
   AUTH_ROLES_SYNC_AT_LOGIN = True
   
   if conf.getboolean("fab", "ENABLE_PROXY_FIX"):
       current_app.wsgi_app = ProxyFix(  # type: ignore
           current_app.wsgi_app,
           x_for=conf.getint("fab", "PROXY_FIX_X_FOR", fallback=1),
           x_proto=conf.getint("fab", "PROXY_FIX_X_PROTO", fallback=1),
           x_host=conf.getint("fab", "PROXY_FIX_X_HOST", fallback=1),
           x_port=conf.getint("fab", "PROXY_FIX_X_PORT", fallback=1),
           x_prefix=conf.getint("fab", "PROXY_FIX_X_PREFIX", fallback=1),
       )
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to