{"id":13191,"date":"2026-05-04T06:00:39","date_gmt":"2026-05-04T10:00:39","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=13191"},"modified":"2026-05-04T06:00:39","modified_gmt":"2026-05-04T10:00:39","slug":"n8n-with-litespeed-web-server","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2026\/05\/04\/n8n-with-litespeed-web-server\/","title":{"rendered":"Proxy n8n with LiteSpeed Web Server"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-large wp-image-13193\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-1024x512.png\" alt=\"n8n with LiteSpeed Web Server\" width=\"1024\" height=\"512\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-1024x512.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-300x150.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-768x384.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-1536x768.png 1536w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-2048x1024.png 2048w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-1320x660.png 1320w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-600x300.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>If you are running cPanel with <a href=\"https:\/\/lswp.store\/articles\/category\/products\/web-server\/\">LiteSpeed Enterprise<\/a> and want to deploy a modern automation service such as <a href=\"https:\/\/n8n.io\/\">n8n<\/a>, the setup can be both straightforward and reliable.<\/p>\n<p>In this article, we will walk through a basic example of running n8n inside Docker on a cPanel server, then publishing it through LiteSpeed Enterprise using reverse proxy rules that support both normal HTTP traffic and WebSocket connections.<\/p>\n<h2 id=\"set-up-n8n\">Set up n8n<\/h2>\n<p>Below is a n8n example <code>docker-compose.yml<\/code> used for the <code>n8n.example.com<\/code> domain:<\/p>\n<pre>version: \"3.8\"\n\nservices:\n  n8n:\n    image: docker.n8n.io\/n8nio\/n8n:latest\n    container_name: n8n\n\n    ports:\n      - \"127.0.0.1:5678:5678\"\n\n    environment:\n      - TZ= America\/Los_Angeles\n      - N8N_HOST=n8n.example.com\n      - N8N_PROTOCOL=https\n      - N8N_PROXY_HOPS=1\n      - WEBHOOK_URL=https:\/\/n8n.example.com\/\n      - N8N_EDITOR_BASE_URL=https:\/\/n8n.example.com\/\n      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true\n      - N8N_RUNNERS_ENABLED=true\n    volumes:\n      - n8n_data:\/home\/node\/.n8n\n\n    restart: unless-stopped\n\nvolumes:\n  n8n_data:\n\n<\/pre>\n<p>A few points are worth highlighting here:<\/p>\n<ul>\n<li><code>N8N_HOST<\/code>, <code>N8N_PROTOCOL<\/code>, <code>WEBHOOK_URL<\/code>, and <code>N8N_EDITOR_BASE_URL<\/code> help n8n understand that it is being served behind HTTPS on the public domain.<\/li>\n<li><code>N8N_PROXY_HOPS=1<\/code> is important when n8n is behind a reverse proxy, because it helps n8n trust the forwarded request information correctly.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/docs.n8n.io\/hosting\/configuration\/environment-variables\/deployment\/\">Learn more<\/a> about n8n environment variables.<\/p>\n<h2 id=\"proxy-setup\">Proxy Setup<\/h2>\n<p>To support both HTTP requests and WebSocket traffic, we used Apache-style userdata include files in cPanel.<\/p>\n<p>We added the following:<\/p>\n<pre>&lt;IfModule mod_rewrite.c&gt; \nRewriteEngine on \nRewriteRule (.*) http:\/\/localhost:5678\/\\$1 [P,L] \nProxyPass \/ ws:\/\/localhost:5678\/ \n&lt;\/IfModule&gt;\n<\/pre>\n<p>to <code>\/etc\/apache2\/conf.d\/userdata\/ssl\/2_4\/n8examplecom\/proxy.conf<\/code> for the SSL configuration and to <code>\/etc\/apache2\/conf.d\/userdata\/std\/2_4\/n8examplecom\/proxy.conf<\/code> for the non-SSL configuration.<\/p>\n<p>This configuration allows the domain to proxy regular traffic to the n8n container on localhost:5678, while also passing WebSocket connections correctly.<\/p>\n<p><strong>Note<\/strong>: The backend target is always plain HTTP because SSL termination happens at the web-server level.<\/p>\n<p>After saving the include files, we rebuilt and reloaded the web server configuration, like so:<\/p>\n<pre>\/scripts\/buildhttpdconf\nsystemctl restart lsws\n<\/pre>\n<h2 id=\"domain-access\">Domain access<\/h2>\n<p>Once DNS, SSL, Docker, and proxy rules are all in place, you can visit the public domain at <code>https:\/\/n8n.example.com<\/code>.<\/p>\n<p>From there, register your account on the n8n instance and begin building workflows.<\/p>\n<h2 id=\"set-up-simple-test-workflow\">Set up simple test workflow<\/h2>\n<p>To confirm that the reverse proxy and application are working properly, create a simple test workflow:<\/p>\n<ol>\n<li>Receive a webhook request<\/li>\n<li>Make an HTTP request to <code>api.ipify.org<\/code><\/li>\n<li>Return the detected IP address as JSON<\/li>\n<\/ol>\n<h3 id=\"webhook-node\">Webhook node<\/h3>\n<p>Use these two URLs:<\/p>\n<ul>\n<li><strong>Test URL<\/strong>: <code>https:\/\/n8n.example.com\/webhook-test\/test-api<\/code><\/li>\n<li><strong>Production URL<\/strong>: <code>https:\/\/n8n.example.com\/webhook\/test-api<\/code><\/li>\n<\/ul>\n<p>Set the webhook response mode to <code>Using \"Respond to Webhook\" node<\/code>.<\/p>\n<h3 id=\"http-request-node\">HTTP Request node<\/h3>\n<p>Create an HTTP Request node with:<\/p>\n<ul>\n<li><strong>Method<\/strong>: <code>GET<\/code><\/li>\n<li><strong>URL<\/strong>: <code>https:\/\/api.ipify.org?format=json<\/code><\/li>\n<\/ul>\n<p>This endpoint returns a simple JSON response containing the requester IP address.<\/p>\n<h3 id=\"respond-to-webhook-node\">Respond to Webhook node<\/h3>\n<p>Set the following:<\/p>\n<ul>\n<li><strong>Respond With<\/strong>: <code>JSON<\/code><\/li>\n<li><strong>Response Body (Expression)<\/strong>:<\/li>\n<\/ul>\n<pre>  {  \n  \"myIP\": \"{{$json.ip}}\"  \n  }  \n<\/pre>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13197 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02-1024x406.jpg\" alt=\"n8n workflow\" width=\"1024\" height=\"406\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02-1024x406.jpg 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02-300x119.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02-768x304.jpg 768w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02-600x238.jpg 600w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-02.jpg 1189w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><br \/>\nThe image above shows what the workflow looks like in the editor.<\/p>\n<h3 id=\"activate-the-workflow\">Activate the workflow<\/h3>\n<p>Activate the workflow to validate the webhook.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-13195\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-01.jpg\" alt=\"n8n with LiteSpeed Web Server test output\" width=\"752\" height=\"380\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-01.jpg 752w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-01-300x152.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n-01-600x303.jpg 600w\" sizes=\"(max-width: 752px) 100vw, 752px\" \/><\/p>\n<p>After activating the workflow, visiting the webhook URL in the browser should return a JSON response showing your IP address, like so:<\/p>\n<pre>{\"myIP\": \"192.0.2.0\"}\n<\/pre>\n<p>This is a simple but useful validation test, because it confirms:<\/p>\n<ul>\n<li>the domain is reachable<\/li>\n<li>HTTPS is working<\/li>\n<li>the reverse proxy is forwarding requests correctly<\/li>\n<li>n8n is processing the workflow<\/li>\n<li>the response is being returned properly through LiteSpeed<\/li>\n<\/ul>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Running n8n on cPanel with LiteSpeed Enterprise and Docker is practical. With the right proxy configuration, it is possible to support both standard HTTP traffic and WebSocket connections cleanly, while keeping the service accessible over HTTPS on its own domain.<\/p>\n<p>If you are looking for a clean way to publish n8n on a LiteSpeed Enterprise server, this is a solid approach.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to proxy n8n with LiteSpeed Web Server, cPanel, and Docker for a modern and reliable automation setup.<\/p>\n","protected":false},"author":1,"featured_media":13193,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[19,27],"tags":[78,93,192,252],"class_list":["post-13191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-slider","category-web-server","tag-cpanel","tag-docker","tag-n8n","tag-reverse-proxy"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2026\/04\/n8n.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/13191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=13191"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/13191\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/13193"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=13191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=13191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=13191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}