ERPNext 13 Behind a Nginx Reverse Proxy

I have installed ERPNext behind an Nginx reverse proxy.

  • The setup is working with SSL and before DNS Multi-tenant is enabled
  • When the DNS multi-tenant turned on, it stops working and I am getting the error message " 404 Not Found 10.148.0.5 does not exist"

Below is the Nginx config file used for reverse proxy. Please help me fix this issue.

server {
    server_name *.mysite.com;

    location / {
        proxy_pass http://10.148.0.5;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host ~ ^[^.]+\.mysite\.com$) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    listen [::]:80;
    server_name *.mysite.com;
    return 404; # managed by Certbot
}

Hey guys, I also met this kind of problem while running my own site, and I need to mention that sometimes even using the proper SSL proxies didn’t help to solve this problem.

In the most cases, if I need to code or visit a website without the support of tls 1.0, I use the Indonesian proxy application because this is the most effective way to solve the problem with compatibility, I don’t know why, but the indian proxy servers are more stable comparing with the other proxies for these purposes.