Ngrok not tunneling properly Nginx
Any request coming in from ngrok, has the Host
header set to the ngrok URL. The behaviour of nginx would be to try and match one of the server
blocks in your configuration above, and default to the first one if no server_name
matches the Host
header.
However, I'm guessing there's another configuration file at /etc/nginx/conf.d/default.conf
or /etc/nginx/sites-enabled/0-default
which has a listen
directive with default_server
set. That will be catching these requests and serving the "Welcome to nginx!" page.
I suggest you look for that file, and remove it which should solve the issue.
However you could also simplify the above configuration and simply have:
server { listen 80; server_name localhost; location / { include proxy_params; proxy_pass http://unix:/home/datascience/chatbot-cima/chatbot.sock; }}
Provided there's not another server
block hiding somewhere else in the configuration with a directive like listen 80 default_server;
then this should catch all requests.
For more info see: How nginx processes a request