Put Strapi Admin behind subdomain using Nginx, with SSL

I tried a lot with Nginx proxy that I could have admin panel (host:1337/admin) on proper domain.
But, I could not. I tried with /admin path to other app with proxy_pass. But, there were some paths that were not having /admin in them and they broke.

I created a subdomain and create nginx configuration. Now, I’m able to open my admin UI in separate subdomain.
Read more: https://www.gyanblog.com/tutorials/how-create-admin-subdomain-cloudflare-nginx-docker-ssl/

Tty this config its working for me

server {
    # Listen HTTP
    listen 80;
    server_name admin.example.com;

    # Proxy Config
    location / {
        proxy_pass http://localhost:1337;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass_request_headers on;