{"id":616,"date":"2023-12-03T18:59:56","date_gmt":"2023-12-03T09:59:56","guid":{"rendered":"https:\/\/blog.peddals.com\/?p=616"},"modified":"2023-12-25T23:33:06","modified_gmt":"2023-12-25T14:33:06","slug":"flet-webapp-behind-apache-by-reverse-proxy","status":"publish","type":"post","link":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/","title":{"rendered":"Host Flet web app behind Apache web server by Reverse Proxy"},"content":{"rendered":"\n<p>Flet, desktop and web app framework is really useful for Python developers. With only little modifications, your standalone desktop app can be hosted on a web server. In this post you can find how to self-host your Flet app on an Apache web server. This is not covered in the Flet official website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick introduction of Flet.<\/h2>\n\n\n\n<p>Flet is a Python framework to build desktop or web application without having knowledges of GUI or web frontend. Flet is developed based on Flutter mobile app framework developed by Google for the Dart language. You&#8217;ll find word &#8220;Flutter&#8221; when you writing codes and getting errors with Flet. I&#8217;m not going to provide more information around Flet or Flutter in this post.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What I&#8217;m going to demonstrate in this post<\/h2>\n\n\n\n<p>The goal is <strong>publish a Flet app on an Apache web server using TCP port based reverse proxy<\/strong>. In my case the web app is only accessible within the LAN. Should you have a publicly accessible Apache server (and admin privileges), you can publish your app to the public. The Flet official webpage <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/deploying-web-app\/hosting-providers\/self-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Self Hosting<\/a> introduces the process to publish on an NGINX web server. You can do pretty much the same thing on an Apache web server by following this post.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Environment<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu 20.04 LTS<\/li>\n\n\n\n<li>Apache 2.4.41<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">High-level steps<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install requirements on Ubuntu server.<\/li>\n\n\n\n<li>Build a Python virtual environment and install Flet.<\/li>\n\n\n\n<li>Prepare a Flet app code.<\/li>\n\n\n\n<li>Enable Apache modules required for reverse proxy.<\/li>\n\n\n\n<li>Write an Apache configuration file.<\/li>\n\n\n\n<li>Write an auto-start configuration file.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Detailed steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Install requirements on Ubuntu server.<\/h3>\n\n\n\n<p>As introduced in the <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/getting-started#linux\" target=\"_blank\" rel=\"noreferrer noopener\">official website<\/a>, you need to install <a href=\"https:\/\/gstreamer.freedesktop.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">GStreamer<\/a> to execute Flet app on a Linux server. Simply follow the <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/getting-started#linux\" target=\"_blank\" rel=\"noreferrer noopener\">steps<\/a> and install requirements.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-lang=\"Bash\"><code>sudo apt-get update\nsudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Build a Python virtual environment and install Flet.<\/h3>\n\n\n\n<p>I use <code>pipenv<\/code> as below. Use your preferred virtual env and install Flet. Flet supports Python 3.8 and above.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-lang=\"Bash\"><code>pipenv --python 3.11\npipenv shell\npip install flet<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Prepare a Flet app code.<\/h3>\n\n\n\n<p>Just for testing, let&#8217;s use a code posted on the official website. To check simple interaction, I copied <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/getting-user-input#event-handlers\" target=\"_blank\" rel=\"noreferrer noopener\">Counter app<\/a> and saved as <code>counter.py<\/code>. Change the last line as below.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-file=\"counter.py\" data-lang=\"Python\"><code>ft.app(target=main, view=None, port=8501)<\/code><\/pre><\/div>\n\n\n\n<p>Quick explanation: <code>view=None<\/code> won&#8217;t open GUI or web browser window, and <code>port=8501<\/code> sets the TCP port to listen to. As long as it does not conflict on your server, any port number works fine. By executing <code>python3 counter.py<\/code>, you can see the app on web browser if installed on your web server by opening <code>http:\/\/localhost:8501<\/code>. Next step is publishing to external access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enable Apache modules required for reverse proxy.<\/h3>\n\n\n\n<p>At least following 4 modules are required to configure Apache as a reverse proxy. As Flet uses web socket, <code>wstunnel<\/code> is also required. Following commands enable modules, load modules and check Apache status respectively.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-lang=\"Bash\"><code>sudo a2enmod proxy proxy_http proxy_wstunnel headers\nsudo systemctl restart apache2\nsudo systemctl status apache2<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Write an Apache configuration file.<\/h3>\n\n\n\n<p>In this example, accessing flet.dev.peddals.com will open the Flet web app. In my environment, access to the subdomain uses always HTTPS as <a href=\"https:\/\/blog.peddals.com\/en\/lets-encrypt-for-apache-dev-site-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">posted separately<\/a>. So, listening port is 443, and reverse proxy port is 8501 that the Flet app is listening to. Please edit these based on your environment.<\/p>\n\n\n\n<p>Line 13-14 for <code>wss:\/\/<\/code> may not be required.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"flet.dev.peddals.conf\"><code>&lt;VirtualHost *:443&gt;\n\tServerName flet.dev.peddals.com\n\n\tSSLEngine on\n\tSSLCertificateFile \/etc\/letsencrypt\/live\/dev.peddals.com\/fullchain.pem\t\n\tSSLCertificateKeyFile \/etc\/letsencrypt\/live\/dev.peddals.com\/privkey.pem\n\n\tProxyRequests Off\n\tProxyPreserveHost On\n\n\tProxyPass \/ws ws:\/\/localhost:8501\/ws\n\tProxyPassReverse \/ws ws:\/\/localhost:8501\/ws\n\tProxyPass \/ws wss:\/\/localhost:8501\/ws\n\tProxyPassReverse \/ws wss:\/\/localhost:8501\/ws\n\tProxyPass \/ http:\/\/localhost:8501\/\n\tProxyPassReverse \/ http:\/\/localhost:8501\/\n\n\tErrorLog ${APACHE_LOG_DIR}\/flet.error.log\n\tCustomLog ${APACHE_LOG_DIR}\/flet.log combined\n\n&lt;\/VirtualHost&gt;<\/code><\/pre><\/div>\n\n\n\n<p>Load Apache configuration (check syntax, load config, and check status).<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-lang=\"Bash\"><code>sudo apachectl configtest\nsudo systemctl reload apache2\nsudo systemctl status apache2<\/code><\/pre><\/div>\n\n\n\n<p>Now, let&#8217;s execute <code>python3 counter.py<\/code> and check if the web app opens from a client PC. If you removed the lines for <code>wss:\/\/<\/code> and the app kept loading, add them, reload, and try again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Write an auto-start configuration file.<\/h3>\n\n\n\n<p>Let&#8217;s follow the <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/deploying-web-app\/hosting-providers\/self-hosting\/#automatically-start-flet-server\" target=\"_blank\" rel=\"noreferrer noopener\">Flet official page<\/a> and write an auto-start configuration file. Below is an example in my server. Save this as <code>fletcounter.service<\/code>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"fletcounter.service\"><code>[Unit]\nDescription=Flet Counter Service\nAfter=network.target\n\n[Service]\nUser=handsome\nGroup=handsome\nWorkingDirectory=\/home\/handsome\/codes\/flet\nEnvironment=&quot;PATH=\/home\/handsome\/.local\/share\/virtualenvs\/flet-xuR7EMBP\/bin\/&quot;\nExecStart=\/home\/handsome\/.local\/share\/virtualenvs\/flet-xuR7EMBP\/bin\/python3 \/home\/handsome\/codes\/flet\/counter.py\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre><\/div>\n\n\n\n<p>Modifications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Description=<\/code> as you like<\/li>\n\n\n\n<li><code>User=<\/code> and <code>Group=<\/code> your own username (<code>whoami<\/code>)<\/li>\n\n\n\n<li><code>WorkingDirectory= <\/code>is the full path to the directory of <code>counter.py<\/code>. <\/li>\n\n\n\n<li><code>Environment=\"PATH=<\/code>  is the full path to the directory of python3  (output of <code>which python3<\/code> up to <code>bin\/<\/code>)<\/li>\n\n\n\n<li><code>ExecStart=<\/code> first arg is full path to Python3 (output of <code>which python3<\/code>), and the second arg is the full path to the Flet app.<\/li>\n<\/ul>\n\n\n\n<p>Lastly, start and enable it as a service by following the <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/deploying-web-app\/hosting-providers\/self-hosting\/#enable-the-flet-server\" target=\"_blank\" rel=\"noreferrer noopener\">official page<\/a>. The target of the symbolic link (#2) is the file created in the previous step.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-lang=\"Bash\"><code>cd \/etc\/systemd\/system\nsudo ln -s \/home\/handsome\/codes\/flet\/fletcounter.service\nsudo systemctl start fletcounter\nsudo systemctl enable fletcounter\nsudo systemctl status fletcounter<\/code><\/pre><\/div>\n\n\n\n<p>That&#8217;s all. Access your app from a client PC and confirm the counter opens. When possible, reboot your server and confirm the service starts automatically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Trouble that I encountered.<\/h2>\n\n\n\n<p>In my environment, loading of the app kept forever initially. I finally figured out that the reverse proxy settings needed <code>ws<strong>s<\/strong>:\/\/<\/code> as well as <code>ws:\/\/ <\/code>(the <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/deploying-web-app\/hosting-providers\/self-hosting\/#nginx-proxy-setup\" target=\"_blank\" rel=\"noreferrer noopener\">NGINX config<\/a> on the official page does not have <code>ws<strong>s<\/strong>:\/\/<\/code> either). It took me some time to figure out that wss stood for Web Socket <strong>S<\/strong>ecured, just like https stood for http Secured. However, another Apache server doesn&#8217;t require wss &#8212; my SSD for the web server (Raspberry Pi) died after reverse proxy setup, and needed to build another. I&#8217;m still not sure why wss was required&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Image by Stable Diffusion<\/h2>\n\n\n\n<p>Date:<br>2023-Nov-25 23:02:10<\/p>\n\n\n\n<p>Model:<br>realisticVision-v20_split-einsum<\/p>\n\n\n\n<p>Size:<br>512 x 512<\/p>\n\n\n\n<p>Include in Image:<br>cartoon, clolorful,<br>modern ladies working at post office classifying letters<\/p>\n\n\n\n<p>Exclude from Image:<\/p>\n\n\n\n<p>Seed:<br>4084494267<\/p>\n\n\n\n<p>Steps:<br>23<\/p>\n\n\n\n<p>Guidance Scale:<br>11.0<\/p>\n\n\n\n<p>Scheduler:<br>DPM-Solver++<\/p>\n\n\n\n<p>ML Compute Unit:<br>CPU &amp; Neural Engine<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flet, desktop and web app framework is really useful for Python developers. With only little modifications, yo &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Host Flet web app behind Apache web server by Reverse Proxy&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":606,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/blog.peddals.com\/?p=600","footnotes":""},"categories":[22,4,21,20],"tags":[17,18],"class_list":["post-616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-python","category-ubuntu","category-website","tag-cli","tag-python","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog<\/title>\n<meta name=\"description\" content=\"Self host Flet app on Apache using TCP port based reverse proxy\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog\" \/>\n<meta property=\"og:description\" content=\"Self host Flet app on Apache using TCP port based reverse proxy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/\" \/>\n<meta property=\"og:site_name\" content=\"Peddals Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-03T09:59:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-25T14:33:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Handsome\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Handsome\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/\"},\"author\":{\"name\":\"Handsome\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"headline\":\"Host Flet web app behind Apache web server by Reverse Proxy\",\"datePublished\":\"2023-12-03T09:59:56+00:00\",\"dateModified\":\"2023-12-25T14:33:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/\"},\"wordCount\":825,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg\",\"keywords\":[\"CLI\",\"Python\"],\"articleSection\":[\"Apache\",\"Python\",\"Ubuntu\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/\",\"name\":\"Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg\",\"datePublished\":\"2023-12-03T09:59:56+00:00\",\"dateModified\":\"2023-12-25T14:33:06+00:00\",\"description\":\"Self host Flet app on Apache using TCP port based reverse proxy\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-webapp-behind-apache-by-reverse-proxy\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/blog.peddals.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Host Flet web app behind Apache web server by Reverse Proxy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/\",\"name\":\"Peddals Blog\",\"description\":\"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.peddals.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\",\"name\":\"Handsome\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"caption\":\"Handsome\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog","description":"Self host Flet app on Apache using TCP port based reverse proxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/","og_locale":"en_US","og_type":"article","og_title":"Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog","og_description":"Self host Flet app on Apache using TCP port based reverse proxy","og_url":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/","og_site_name":"Peddals Blog","article_published_time":"2023-12-03T09:59:56+00:00","article_modified_time":"2023-12-25T14:33:06+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg","type":"image\/jpeg"}],"author":"Handsome","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Handsome","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#article","isPartOf":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/"},"author":{"name":"Handsome","@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"headline":"Host Flet web app behind Apache web server by Reverse Proxy","datePublished":"2023-12-03T09:59:56+00:00","dateModified":"2023-12-25T14:33:06+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/"},"wordCount":825,"commentCount":2,"publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg","keywords":["CLI","Python"],"articleSection":["Apache","Python","Ubuntu","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/","url":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/","name":"Host Flet web app behind Apache web server by Reverse Proxy | Peddals Blog","isPartOf":{"@id":"https:\/\/blog.peddals.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#primaryimage"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg","datePublished":"2023-12-03T09:59:56+00:00","dateModified":"2023-12-25T14:33:06+00:00","description":"Self host Flet app on Apache using TCP port based reverse proxy","breadcrumb":{"@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#primaryimage","url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg","contentUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2023\/11\/cartoon-clolorful-0Amodern-ladies-working-at-post-office-classifying.353.4084494267.jpg","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peddals.com\/en\/flet-webapp-behind-apache-by-reverse-proxy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/blog.peddals.com\/"},{"@type":"ListItem","position":2,"name":"Host Flet web app behind Apache web server by Reverse Proxy"}]},{"@type":"WebSite","@id":"https:\/\/blog.peddals.com\/#website","url":"https:\/\/blog.peddals.com\/","name":"Peddals Blog","description":"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English","publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.peddals.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994","name":"Handsome","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","caption":"Handsome"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/comments?post=616"}],"version-history":[{"count":11,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/616\/revisions"}],"predecessor-version":[{"id":661,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/616\/revisions\/661"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media\/606"}],"wp:attachment":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media?parent=616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/categories?post=616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/tags?post=616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}