NGINX + N8N : WebHook call from Postman returns HTML Page with 200 OK

Describe the problem/error/question

Setting up a new N8N but has to be behind Nginx (personal instance, cant afford another server for N8N). The setup with Nginx works except for the Webhooks.

I setup a simple workflow (as below), “Test Workflow”, then the WebHook starts listening. I take the Webhook Test URL in Postman (GET + URL) and send the request.

Response:
Status: 200 OK
Payload:
HTML Page Source Code with title “n8n.io - Workflow Automation” and body that says:

		<noscript>
			<strong
				>We're sorry but the n8n Editor-UI doesn't work properly without JavaScript enabled. Please
				enable it to continue.</strong
			>
		</noscript>

NOTE: The workflow does not trigger, does not timeout and I cannot stop the execution.

My Nginx config for N8N is as below:

        location /n8n {
                proxy_pass http://127.0.0.1:5678/;
                proxy_http_version      1.1;
                proxy_set_header Connection '';
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_set_header   Host $http_host;
                proxy_buffering off;
                proxy_cache off;
                chunked_transfer_encoding off;
        }

        location ~ ^/(webhook|webhook-test) {
                proxy_set_header Connection '';
                chunked_transfer_encoding off;
                proxy_buffering off;
                proxy_cache off;
                #include /config/nginx/proxy.conf;
                #include /config/nginx/resolver.conf;
                set $upstream_app n8n;
                set $upstream_port 5678;
                set $upstream_proto http;
                proxy_pass $upstream_proto://$upstream_app:$upstream_port;
                #proxy_pass http://n8n:5678/;
        }

What is the error message (if any)?

No error message

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:1.32.2
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

New Note 1 : Everytime I execute a workflow I see the following line in the log:

pf_n8n | The session “XXXXXXXXX” is not registered.

New Note 2 : I cannot even execute a Workflow with Manual Trigger. This makes me think on why the I would get the specific message in Postman. May be the Workflow is not actually getting triggered and hence there is no Webhook to call?

Update:

After looking at my previous deployment, added Webhook support to the nginx.conf.

        location /n8n {
                proxy_pass http://127.0.0.1:5678/;
#               proxy_http_version      1.1;
                proxy_set_header Connection '';
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_set_header   Host $http_host;
                proxy_buffering off;
                proxy_cache off;
                chunked_transfer_encoding off;

                # WebSocket support
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

        location ~ ^/(webhook|webhook-test) {
                proxy_set_header Connection '';
                chunked_transfer_encoding off;
                proxy_buffering off;
                proxy_cache off;
                #include /config/nginx/proxy.conf;
                #include /config/nginx/resolver.conf;
                set $upstream_app localhost;
                set $upstream_port 5678;
                set $upstream_proto http;
                proxy_pass $upstream_proto://$upstream_app:$upstream_port;
#               #proxy_pass http://n8n:5678/;
        }

So now…

  1. I can now Manually stop the workflow
  2. The log messages about “session” stopped showing up

BUT the Webhook is still returning the same HTML message!

Hi @sg_tech! Thanks for reaching out! I appreciate you sharing the incremental steps you’ve taken to resolving the issues you’re seeing.

From your latest message it sounds like you’re now able to trigger the workflow, stop the workflow, but you are trying to access the editor via Postman and hence seeing the noscript message, correct? Have you tried to access the editor from your browser?

Hello,

I am trying to call the Webhook URL to trigger a Workflow from Postman to test and thats when I get the HTML page in response.

I just put the WebHook GET URL in Chrome (just for sake of it) and I do see the below message.

Note that the Title and the URL actually seem to be alright.

Hope this makes things more clear?

Thanks and regards,

SG

Ah thank you for the clarity there. Yes, the webhook url would not be accessible from the browser as that should just be the destination for the request. From Postman you would normally expect the output from successfully calling a webhook to be {"message":"Workflow was started"}%

Is the response the same if you activate the workflow and use the non-test webhook url?

Additionally, here are some resources that might be useful:

Yes,

The response is same whether I call the WebHook from Test or Prod (Active) URL.

I will look at the posts later today and see if anything helps…

Thanks and regards,

SG

Hi @sg_tech did you account for the /n8n subfolder in your path when you defined the proxy configuration?

Yes, you can see that in the Postman URL from the image I posted in the previous reply.

Didnt find time to work on this but will start investigating next week.

Any help is appreciated since this is the only thing stopping me from using N8N :slight_smile: .

Ok, I’ve spent about 3 additional hours trying to solve this but nothing seems to work.

Tried several ways to remove the Webhook issue but no luck.

I have set up n8n for a POC on my company network on the root nginx path i.e. /, so now I exposed it via an additional nginx server block with a sub-domain but no luck again.

Tomorrow I am going to try and run it with nginx → npm and see if it works. I hope it does.

If not, then I will not be able to have a dedicated VM in my company cloud just for n8n.

We will have to drop plans for self-hosted pro/ent package and try and find some other alternative :frowning:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.