Any Ideas how to host windows panel app on windows IIS server. I did the basic setup with making panel app servable and works. But users aren’t authenticated with active directory and I believe that is why i cant get user-info inside my panel code. Believe it is just a default user. Need to have a panel object inside my code return user-info.
found this post, was wondering if i get a reverse proxy up an open the inbound port 8080, if panel would then be able to access user info with pn.state.curdoc.session_context.request.cookies[“user”]
The goal is to use IIS as a reverse proxy. IIS is not a reverse proxy by default, so we have to add some modules and then start the configuration. These are all the steps I took:
- Install the URL Rewrite package from the Downloads section on the IIS website.
- Install the ARR (application request routing) module from the Downloads section on the IIS website.
- In IIS, under sites, add a new website and set the Host Name to your FQDN. Also, Choose a Site Name and a Physical Path (I think it doesn’t matter what.) and click OK.
- In the left pane, double-click on the website you created. In the modules, double-click on URL Rewrite, then click on Add Rule(s), choose Reverse Proxy and click OK. Then in the new window type 127.0.0.1:my_bokeh_port and hit OK.
- From the left pane, double-click on the main tree node with your server name on it, and from the modules, double-click on Application Request Routing Cache. In the right pane, choose Enable proxy, and set HTTP version to Pass through.
- Use this guide to set Server Farms. Honestly, I’m not really sure if this step is necessary, but since I had done it before some of the former steps I just mentioned, I thought it might be.
- Close and restart IIS.
- Now, if you go to your website in your browser, you will probably see your address (for example x.y.‘com’) change to x.y.‘com’/app_myapp. If you can also see your dashboard, then that’s all. If not, however, it means that your firewall is blocking the WebSocket connection. You can use this guide to allow a TCP connection to your Bokeh port.
- Hopefully, now you can refresh and see your dashboard.
Little confused on best practice to host panel apps on webserver. Seems silly to use reverse proxy on IIS server when I can implement adauth with this bartbroere/bokeh-active-directory: Active Directory authentication for Bokeh servers (github.com) .
from tornado.web import decode_signed_value
secure_cookie = pn.state.curdoc.session_context.request.cookies[“user”]
user = decode_signed_value(cookie_secret, “user”, secure_cookie).decode(“utf-8”)
Any thoughts guys ???